Skip to main content

browser_protocol/storage/
mod.rs

1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3
4
5pub type SerializedStorageKey = String;
6
7/// Enum of possible storage types.
8
9#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
10pub enum StorageType {
11    #[default]
12    Cookies,
13    FileSystems,
14    Indexeddb,
15    LocalStorage,
16    ShaderCache,
17    Websql,
18    ServiceWorkers,
19    CacheStorage,
20    InterestGroups,
21    SharedStorage,
22    StorageBuckets,
23    All,
24    Other,
25}
26
27/// Usage for a storage type.
28
29#[derive(Debug, Clone, Serialize, Deserialize, Default)]
30#[serde(rename_all = "camelCase")]
31pub struct UsageForType {
32    /// Name of storage type.
33
34    pub storageType: StorageType,
35    /// Storage usage (bytes).
36
37    pub usage: f64,
38}
39
40/// Pair of issuer origin and number of available (signed, but not used) Trust
41/// Tokens from that issuer.
42
43#[derive(Debug, Clone, Serialize, Deserialize, Default)]
44#[serde(rename_all = "camelCase")]
45pub struct TrustTokens {
46
47    pub issuerOrigin: String,
48
49    pub count: f64,
50}
51
52/// Protected audience interest group auction identifier.
53
54pub type InterestGroupAuctionId = String;
55
56/// Enum of interest group access types.
57
58#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
59pub enum InterestGroupAccessType {
60    #[default]
61    Join,
62    Leave,
63    Update,
64    Loaded,
65    Bid,
66    Win,
67    AdditionalBid,
68    AdditionalBidWin,
69    TopLevelBid,
70    TopLevelAdditionalBid,
71    Clear,
72}
73
74/// Enum of auction events.
75
76#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
77pub enum InterestGroupAuctionEventType {
78    #[default]
79    Started,
80    ConfigResolved,
81}
82
83/// Enum of network fetches auctions can do.
84
85#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
86pub enum InterestGroupAuctionFetchType {
87    #[default]
88    BidderJs,
89    BidderWasm,
90    SellerJs,
91    BidderTrustedSignals,
92    SellerTrustedSignals,
93}
94
95/// Enum of shared storage access scopes.
96
97#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
98pub enum SharedStorageAccessScope {
99    #[default]
100    Window,
101    SharedStorageWorklet,
102    ProtectedAudienceWorklet,
103    Header,
104}
105
106/// Enum of shared storage access methods.
107
108#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
109pub enum SharedStorageAccessMethod {
110    #[default]
111    AddModule,
112    CreateWorklet,
113    SelectURL,
114    Run,
115    BatchUpdate,
116    Set,
117    Append,
118    Delete,
119    Clear,
120    Get,
121    Keys,
122    Values,
123    Entries,
124    Length,
125    RemainingBudget,
126}
127
128/// Struct for a single key-value pair in an origin's shared storage.
129
130#[derive(Debug, Clone, Serialize, Deserialize, Default)]
131#[serde(rename_all = "camelCase")]
132pub struct SharedStorageEntry {
133
134    pub key: String,
135
136    pub value: String,
137}
138
139/// Details for an origin's shared storage.
140
141#[derive(Debug, Clone, Serialize, Deserialize, Default)]
142#[serde(rename_all = "camelCase")]
143pub struct SharedStorageMetadata {
144    /// Time when the origin's shared storage was last created.
145
146    pub creationTime: crate::network::TimeSinceEpoch,
147    /// Number of key-value pairs stored in origin's shared storage.
148
149    pub length: u64,
150    /// Current amount of bits of entropy remaining in the navigation budget.
151
152    pub remainingBudget: f64,
153    /// Total number of bytes stored as key-value pairs in origin's shared
154    /// storage.
155
156    pub bytesUsed: i64,
157}
158
159/// Represents a dictionary object passed in as privateAggregationConfig to
160/// run or selectURL.
161
162#[derive(Debug, Clone, Serialize, Deserialize, Default)]
163#[serde(rename_all = "camelCase")]
164pub struct SharedStoragePrivateAggregationConfig {
165    /// The chosen aggregation service deployment.
166
167    #[serde(skip_serializing_if = "Option::is_none")]
168    pub aggregationCoordinatorOrigin: Option<String>,
169    /// The context ID provided.
170
171    #[serde(skip_serializing_if = "Option::is_none")]
172    pub contextId: Option<String>,
173    /// Configures the maximum size allowed for filtering IDs.
174
175    pub filteringIdMaxBytes: u64,
176    /// The limit on the number of contributions in the final report.
177
178    #[serde(skip_serializing_if = "Option::is_none")]
179    pub maxContributions: Option<i64>,
180}
181
182/// Pair of reporting metadata details for a candidate URL for 'selectURL()'.
183
184#[derive(Debug, Clone, Serialize, Deserialize, Default)]
185#[serde(rename_all = "camelCase")]
186pub struct SharedStorageReportingMetadata {
187
188    pub eventType: String,
189
190    pub reportingUrl: String,
191}
192
193/// Bundles a candidate URL with its reporting metadata.
194
195#[derive(Debug, Clone, Serialize, Deserialize, Default)]
196#[serde(rename_all = "camelCase")]
197pub struct SharedStorageUrlWithMetadata {
198    /// Spec of candidate URL.
199
200    pub url: String,
201    /// Any associated reporting metadata.
202
203    pub reportingMetadata: Vec<SharedStorageReportingMetadata>,
204}
205
206/// Bundles the parameters for shared storage access events whose
207/// presence/absence can vary according to SharedStorageAccessType.
208
209#[derive(Debug, Clone, Serialize, Deserialize, Default)]
210#[serde(rename_all = "camelCase")]
211pub struct SharedStorageAccessParams {
212    /// Spec of the module script URL.
213    /// Present only for SharedStorageAccessMethods: addModule and
214    /// createWorklet.
215
216    #[serde(skip_serializing_if = "Option::is_none")]
217    pub scriptSourceUrl: Option<String>,
218    /// String denoting "context-origin", "script-origin", or a custom
219    /// origin to be used as the worklet's data origin.
220    /// Present only for SharedStorageAccessMethod: createWorklet.
221
222    #[serde(skip_serializing_if = "Option::is_none")]
223    pub dataOrigin: Option<String>,
224    /// Name of the registered operation to be run.
225    /// Present only for SharedStorageAccessMethods: run and selectURL.
226
227    #[serde(skip_serializing_if = "Option::is_none")]
228    pub operationName: Option<String>,
229    /// ID of the operation call.
230    /// Present only for SharedStorageAccessMethods: run and selectURL.
231
232    #[serde(skip_serializing_if = "Option::is_none")]
233    pub operationId: Option<String>,
234    /// Whether or not to keep the worket alive for future run or selectURL
235    /// calls.
236    /// Present only for SharedStorageAccessMethods: run and selectURL.
237
238    #[serde(skip_serializing_if = "Option::is_none")]
239    pub keepAlive: Option<bool>,
240    /// Configures the private aggregation options.
241    /// Present only for SharedStorageAccessMethods: run and selectURL.
242
243    #[serde(skip_serializing_if = "Option::is_none")]
244    pub privateAggregationConfig: Option<SharedStoragePrivateAggregationConfig>,
245    /// The operation's serialized data in bytes (converted to a string).
246    /// Present only for SharedStorageAccessMethods: run and selectURL.
247    /// TODO(crbug.com/401011862): Consider updating this parameter to binary.
248
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub serializedData: Option<String>,
251    /// Array of candidate URLs' specs, along with any associated metadata.
252    /// Present only for SharedStorageAccessMethod: selectURL.
253
254    #[serde(skip_serializing_if = "Option::is_none")]
255    pub urlsWithMetadata: Option<Vec<SharedStorageUrlWithMetadata>>,
256    /// Spec of the URN:UUID generated for a selectURL call.
257    /// Present only for SharedStorageAccessMethod: selectURL.
258
259    #[serde(skip_serializing_if = "Option::is_none")]
260    pub urnUuid: Option<String>,
261    /// Key for a specific entry in an origin's shared storage.
262    /// Present only for SharedStorageAccessMethods: set, append, delete, and
263    /// get.
264
265    #[serde(skip_serializing_if = "Option::is_none")]
266    pub key: Option<String>,
267    /// Value for a specific entry in an origin's shared storage.
268    /// Present only for SharedStorageAccessMethods: set and append.
269
270    #[serde(skip_serializing_if = "Option::is_none")]
271    pub value: Option<String>,
272    /// Whether or not to set an entry for a key if that key is already present.
273    /// Present only for SharedStorageAccessMethod: set.
274
275    #[serde(skip_serializing_if = "Option::is_none")]
276    pub ignoreIfPresent: Option<bool>,
277    /// A number denoting the (0-based) order of the worklet's
278    /// creation relative to all other shared storage worklets created by
279    /// documents using the current storage partition.
280    /// Present only for SharedStorageAccessMethods: addModule, createWorklet.
281
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub workletOrdinal: Option<i64>,
284    /// Hex representation of the DevTools token used as the TargetID for the
285    /// associated shared storage worklet.
286    /// Present only for SharedStorageAccessMethods: addModule, createWorklet,
287    /// run, selectURL, and any other SharedStorageAccessMethod when the
288    /// SharedStorageAccessScope is sharedStorageWorklet.
289
290    #[serde(skip_serializing_if = "Option::is_none")]
291    pub workletTargetId: Option<crate::target::TargetID>,
292    /// Name of the lock to be acquired, if present.
293    /// Optionally present only for SharedStorageAccessMethods: batchUpdate,
294    /// set, append, delete, and clear.
295
296    #[serde(skip_serializing_if = "Option::is_none")]
297    pub withLock: Option<String>,
298    /// If the method has been called as part of a batchUpdate, then this
299    /// number identifies the batch to which it belongs.
300    /// Optionally present only for SharedStorageAccessMethods:
301    /// batchUpdate (required), set, append, delete, and clear.
302
303    #[serde(skip_serializing_if = "Option::is_none")]
304    pub batchUpdateId: Option<String>,
305    /// Number of modifier methods sent in batch.
306    /// Present only for SharedStorageAccessMethod: batchUpdate.
307
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub batchSize: Option<u64>,
310}
311
312
313#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
314pub enum StorageBucketsDurability {
315    #[default]
316    Relaxed,
317    Strict,
318}
319
320
321#[derive(Debug, Clone, Serialize, Deserialize, Default)]
322#[serde(rename_all = "camelCase")]
323pub struct StorageBucket {
324
325    pub storageKey: SerializedStorageKey,
326    /// If not specified, it is the default bucket of the storageKey.
327
328    #[serde(skip_serializing_if = "Option::is_none")]
329    pub name: Option<String>,
330}
331
332
333#[derive(Debug, Clone, Serialize, Deserialize, Default)]
334#[serde(rename_all = "camelCase")]
335pub struct StorageBucketInfo {
336
337    pub bucket: StorageBucket,
338
339    pub id: String,
340
341    pub expiration: crate::network::TimeSinceEpoch,
342    /// Storage quota (bytes).
343
344    pub quota: f64,
345
346    pub persistent: bool,
347
348    pub durability: StorageBucketsDurability,
349}
350
351/// A single Related Website Set object.
352
353#[derive(Debug, Clone, Serialize, Deserialize, Default)]
354#[serde(rename_all = "camelCase")]
355pub struct RelatedWebsiteSet {
356    /// The primary site of this set, along with the ccTLDs if there is any.
357
358    pub primarySites: Vec<String>,
359    /// The associated sites of this set, along with the ccTLDs if there is any.
360
361    pub associatedSites: Vec<String>,
362    /// The service sites of this set, along with the ccTLDs if there is any.
363
364    pub serviceSites: Vec<String>,
365}
366
367/// Returns a storage key given a frame id.
368/// Deprecated. Please use Storage.getStorageKey instead.
369
370#[derive(Debug, Clone, Serialize, Deserialize, Default)]
371#[serde(rename_all = "camelCase")]
372pub struct GetStorageKeyForFrameParams {
373
374    pub frameId: crate::page::FrameId,
375}
376
377/// Returns a storage key given a frame id.
378/// Deprecated. Please use Storage.getStorageKey instead.
379
380#[derive(Debug, Clone, Serialize, Deserialize, Default)]
381#[serde(rename_all = "camelCase")]
382pub struct GetStorageKeyForFrameReturns {
383
384    pub storageKey: SerializedStorageKey,
385}
386
387impl GetStorageKeyForFrameParams { pub const METHOD: &'static str = "Storage.getStorageKeyForFrame"; }
388
389impl crate::CdpCommand for GetStorageKeyForFrameParams {
390    const METHOD: &'static str = "Storage.getStorageKeyForFrame";
391    type Response = GetStorageKeyForFrameReturns;
392}
393
394/// Returns storage key for the given frame. If no frame ID is provided,
395/// the storage key of the target executing this command is returned.
396
397#[derive(Debug, Clone, Serialize, Deserialize, Default)]
398#[serde(rename_all = "camelCase")]
399pub struct GetStorageKeyParams {
400
401    #[serde(skip_serializing_if = "Option::is_none")]
402    pub frameId: Option<crate::page::FrameId>,
403}
404
405/// Returns storage key for the given frame. If no frame ID is provided,
406/// the storage key of the target executing this command is returned.
407
408#[derive(Debug, Clone, Serialize, Deserialize, Default)]
409#[serde(rename_all = "camelCase")]
410pub struct GetStorageKeyReturns {
411
412    pub storageKey: SerializedStorageKey,
413}
414
415impl GetStorageKeyParams { pub const METHOD: &'static str = "Storage.getStorageKey"; }
416
417impl crate::CdpCommand for GetStorageKeyParams {
418    const METHOD: &'static str = "Storage.getStorageKey";
419    type Response = GetStorageKeyReturns;
420}
421
422/// Clears storage for origin.
423
424#[derive(Debug, Clone, Serialize, Deserialize, Default)]
425#[serde(rename_all = "camelCase")]
426pub struct ClearDataForOriginParams {
427    /// Security origin.
428
429    pub origin: String,
430    /// Comma separated list of StorageType to clear.
431
432    pub storageTypes: String,
433}
434
435impl ClearDataForOriginParams { pub const METHOD: &'static str = "Storage.clearDataForOrigin"; }
436
437impl crate::CdpCommand for ClearDataForOriginParams {
438    const METHOD: &'static str = "Storage.clearDataForOrigin";
439    type Response = crate::EmptyReturns;
440}
441
442/// Clears storage for storage key.
443
444#[derive(Debug, Clone, Serialize, Deserialize, Default)]
445#[serde(rename_all = "camelCase")]
446pub struct ClearDataForStorageKeyParams {
447    /// Storage key.
448
449    pub storageKey: String,
450    /// Comma separated list of StorageType to clear.
451
452    pub storageTypes: String,
453}
454
455impl ClearDataForStorageKeyParams { pub const METHOD: &'static str = "Storage.clearDataForStorageKey"; }
456
457impl crate::CdpCommand for ClearDataForStorageKeyParams {
458    const METHOD: &'static str = "Storage.clearDataForStorageKey";
459    type Response = crate::EmptyReturns;
460}
461
462/// Returns all browser cookies.
463
464#[derive(Debug, Clone, Serialize, Deserialize, Default)]
465#[serde(rename_all = "camelCase")]
466pub struct GetCookiesParams {
467    /// Browser context to use when called on the browser endpoint.
468
469    #[serde(skip_serializing_if = "Option::is_none")]
470    pub browserContextId: Option<crate::browser::BrowserContextID>,
471}
472
473/// Returns all browser cookies.
474
475#[derive(Debug, Clone, Serialize, Deserialize, Default)]
476#[serde(rename_all = "camelCase")]
477pub struct GetCookiesReturns {
478    /// Array of cookie objects.
479
480    pub cookies: Vec<crate::network::Cookie>,
481}
482
483impl GetCookiesParams { pub const METHOD: &'static str = "Storage.getCookies"; }
484
485impl crate::CdpCommand for GetCookiesParams {
486    const METHOD: &'static str = "Storage.getCookies";
487    type Response = GetCookiesReturns;
488}
489
490/// Sets given cookies.
491
492#[derive(Debug, Clone, Serialize, Deserialize, Default)]
493#[serde(rename_all = "camelCase")]
494pub struct SetCookiesParams {
495    /// Cookies to be set.
496
497    pub cookies: Vec<crate::network::CookieParam>,
498    /// Browser context to use when called on the browser endpoint.
499
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub browserContextId: Option<crate::browser::BrowserContextID>,
502}
503
504impl SetCookiesParams { pub const METHOD: &'static str = "Storage.setCookies"; }
505
506impl crate::CdpCommand for SetCookiesParams {
507    const METHOD: &'static str = "Storage.setCookies";
508    type Response = crate::EmptyReturns;
509}
510
511/// Clears cookies.
512
513#[derive(Debug, Clone, Serialize, Deserialize, Default)]
514#[serde(rename_all = "camelCase")]
515pub struct ClearCookiesParams {
516    /// Browser context to use when called on the browser endpoint.
517
518    #[serde(skip_serializing_if = "Option::is_none")]
519    pub browserContextId: Option<crate::browser::BrowserContextID>,
520}
521
522impl ClearCookiesParams { pub const METHOD: &'static str = "Storage.clearCookies"; }
523
524impl crate::CdpCommand for ClearCookiesParams {
525    const METHOD: &'static str = "Storage.clearCookies";
526    type Response = crate::EmptyReturns;
527}
528
529/// Returns usage and quota in bytes.
530
531#[derive(Debug, Clone, Serialize, Deserialize, Default)]
532#[serde(rename_all = "camelCase")]
533pub struct GetUsageAndQuotaParams {
534    /// Security origin.
535
536    pub origin: String,
537}
538
539/// Returns usage and quota in bytes.
540
541#[derive(Debug, Clone, Serialize, Deserialize, Default)]
542#[serde(rename_all = "camelCase")]
543pub struct GetUsageAndQuotaReturns {
544    /// Storage usage (bytes).
545
546    pub usage: f64,
547    /// Storage quota (bytes).
548
549    pub quota: f64,
550    /// Whether or not the origin has an active storage quota override
551
552    pub overrideActive: bool,
553    /// Storage usage per type (bytes).
554
555    pub usageBreakdown: Vec<UsageForType>,
556}
557
558impl GetUsageAndQuotaParams { pub const METHOD: &'static str = "Storage.getUsageAndQuota"; }
559
560impl crate::CdpCommand for GetUsageAndQuotaParams {
561    const METHOD: &'static str = "Storage.getUsageAndQuota";
562    type Response = GetUsageAndQuotaReturns;
563}
564
565/// Override quota for the specified origin
566
567#[derive(Debug, Clone, Serialize, Deserialize, Default)]
568#[serde(rename_all = "camelCase")]
569pub struct OverrideQuotaForOriginParams {
570    /// Security origin.
571
572    pub origin: String,
573    /// The quota size (in bytes) to override the original quota with.
574    /// If this is called multiple times, the overridden quota will be equal to
575    /// the quotaSize provided in the final call. If this is called without
576    /// specifying a quotaSize, the quota will be reset to the default value for
577    /// the specified origin. If this is called multiple times with different
578    /// origins, the override will be maintained for each origin until it is
579    /// disabled (called without a quotaSize).
580
581    #[serde(skip_serializing_if = "Option::is_none")]
582    pub quotaSize: Option<f64>,
583}
584
585impl OverrideQuotaForOriginParams { pub const METHOD: &'static str = "Storage.overrideQuotaForOrigin"; }
586
587impl crate::CdpCommand for OverrideQuotaForOriginParams {
588    const METHOD: &'static str = "Storage.overrideQuotaForOrigin";
589    type Response = crate::EmptyReturns;
590}
591
592/// Registers origin to be notified when an update occurs to its cache storage list.
593
594#[derive(Debug, Clone, Serialize, Deserialize, Default)]
595#[serde(rename_all = "camelCase")]
596pub struct TrackCacheStorageForOriginParams {
597    /// Security origin.
598
599    pub origin: String,
600}
601
602impl TrackCacheStorageForOriginParams { pub const METHOD: &'static str = "Storage.trackCacheStorageForOrigin"; }
603
604impl crate::CdpCommand for TrackCacheStorageForOriginParams {
605    const METHOD: &'static str = "Storage.trackCacheStorageForOrigin";
606    type Response = crate::EmptyReturns;
607}
608
609/// Registers storage key to be notified when an update occurs to its cache storage list.
610
611#[derive(Debug, Clone, Serialize, Deserialize, Default)]
612#[serde(rename_all = "camelCase")]
613pub struct TrackCacheStorageForStorageKeyParams {
614    /// Storage key.
615
616    pub storageKey: String,
617}
618
619impl TrackCacheStorageForStorageKeyParams { pub const METHOD: &'static str = "Storage.trackCacheStorageForStorageKey"; }
620
621impl crate::CdpCommand for TrackCacheStorageForStorageKeyParams {
622    const METHOD: &'static str = "Storage.trackCacheStorageForStorageKey";
623    type Response = crate::EmptyReturns;
624}
625
626/// Registers origin to be notified when an update occurs to its IndexedDB.
627
628#[derive(Debug, Clone, Serialize, Deserialize, Default)]
629#[serde(rename_all = "camelCase")]
630pub struct TrackIndexedDBForOriginParams {
631    /// Security origin.
632
633    pub origin: String,
634}
635
636impl TrackIndexedDBForOriginParams { pub const METHOD: &'static str = "Storage.trackIndexedDBForOrigin"; }
637
638impl crate::CdpCommand for TrackIndexedDBForOriginParams {
639    const METHOD: &'static str = "Storage.trackIndexedDBForOrigin";
640    type Response = crate::EmptyReturns;
641}
642
643/// Registers storage key to be notified when an update occurs to its IndexedDB.
644
645#[derive(Debug, Clone, Serialize, Deserialize, Default)]
646#[serde(rename_all = "camelCase")]
647pub struct TrackIndexedDBForStorageKeyParams {
648    /// Storage key.
649
650    pub storageKey: String,
651}
652
653impl TrackIndexedDBForStorageKeyParams { pub const METHOD: &'static str = "Storage.trackIndexedDBForStorageKey"; }
654
655impl crate::CdpCommand for TrackIndexedDBForStorageKeyParams {
656    const METHOD: &'static str = "Storage.trackIndexedDBForStorageKey";
657    type Response = crate::EmptyReturns;
658}
659
660/// Unregisters origin from receiving notifications for cache storage.
661
662#[derive(Debug, Clone, Serialize, Deserialize, Default)]
663#[serde(rename_all = "camelCase")]
664pub struct UntrackCacheStorageForOriginParams {
665    /// Security origin.
666
667    pub origin: String,
668}
669
670impl UntrackCacheStorageForOriginParams { pub const METHOD: &'static str = "Storage.untrackCacheStorageForOrigin"; }
671
672impl crate::CdpCommand for UntrackCacheStorageForOriginParams {
673    const METHOD: &'static str = "Storage.untrackCacheStorageForOrigin";
674    type Response = crate::EmptyReturns;
675}
676
677/// Unregisters storage key from receiving notifications for cache storage.
678
679#[derive(Debug, Clone, Serialize, Deserialize, Default)]
680#[serde(rename_all = "camelCase")]
681pub struct UntrackCacheStorageForStorageKeyParams {
682    /// Storage key.
683
684    pub storageKey: String,
685}
686
687impl UntrackCacheStorageForStorageKeyParams { pub const METHOD: &'static str = "Storage.untrackCacheStorageForStorageKey"; }
688
689impl crate::CdpCommand for UntrackCacheStorageForStorageKeyParams {
690    const METHOD: &'static str = "Storage.untrackCacheStorageForStorageKey";
691    type Response = crate::EmptyReturns;
692}
693
694/// Unregisters origin from receiving notifications for IndexedDB.
695
696#[derive(Debug, Clone, Serialize, Deserialize, Default)]
697#[serde(rename_all = "camelCase")]
698pub struct UntrackIndexedDBForOriginParams {
699    /// Security origin.
700
701    pub origin: String,
702}
703
704impl UntrackIndexedDBForOriginParams { pub const METHOD: &'static str = "Storage.untrackIndexedDBForOrigin"; }
705
706impl crate::CdpCommand for UntrackIndexedDBForOriginParams {
707    const METHOD: &'static str = "Storage.untrackIndexedDBForOrigin";
708    type Response = crate::EmptyReturns;
709}
710
711/// Unregisters storage key from receiving notifications for IndexedDB.
712
713#[derive(Debug, Clone, Serialize, Deserialize, Default)]
714#[serde(rename_all = "camelCase")]
715pub struct UntrackIndexedDBForStorageKeyParams {
716    /// Storage key.
717
718    pub storageKey: String,
719}
720
721impl UntrackIndexedDBForStorageKeyParams { pub const METHOD: &'static str = "Storage.untrackIndexedDBForStorageKey"; }
722
723impl crate::CdpCommand for UntrackIndexedDBForStorageKeyParams {
724    const METHOD: &'static str = "Storage.untrackIndexedDBForStorageKey";
725    type Response = crate::EmptyReturns;
726}
727
728/// Returns the number of stored Trust Tokens per issuer for the
729/// current browsing context.
730
731#[derive(Debug, Clone, Serialize, Deserialize, Default)]
732#[serde(rename_all = "camelCase")]
733pub struct GetTrustTokensReturns {
734
735    pub tokens: Vec<TrustTokens>,
736}
737
738#[derive(Debug, Clone, Serialize, Deserialize, Default)]
739pub struct GetTrustTokensParams {}
740
741impl GetTrustTokensParams { pub const METHOD: &'static str = "Storage.getTrustTokens"; }
742
743impl crate::CdpCommand for GetTrustTokensParams {
744    const METHOD: &'static str = "Storage.getTrustTokens";
745    type Response = GetTrustTokensReturns;
746}
747
748/// Removes all Trust Tokens issued by the provided issuerOrigin.
749/// Leaves other stored data, including the issuer's Redemption Records, intact.
750
751#[derive(Debug, Clone, Serialize, Deserialize, Default)]
752#[serde(rename_all = "camelCase")]
753pub struct ClearTrustTokensParams {
754
755    pub issuerOrigin: String,
756}
757
758/// Removes all Trust Tokens issued by the provided issuerOrigin.
759/// Leaves other stored data, including the issuer's Redemption Records, intact.
760
761#[derive(Debug, Clone, Serialize, Deserialize, Default)]
762#[serde(rename_all = "camelCase")]
763pub struct ClearTrustTokensReturns {
764    /// True if any tokens were deleted, false otherwise.
765
766    pub didDeleteTokens: bool,
767}
768
769impl ClearTrustTokensParams { pub const METHOD: &'static str = "Storage.clearTrustTokens"; }
770
771impl crate::CdpCommand for ClearTrustTokensParams {
772    const METHOD: &'static str = "Storage.clearTrustTokens";
773    type Response = ClearTrustTokensReturns;
774}
775
776/// Gets details for a named interest group.
777
778#[derive(Debug, Clone, Serialize, Deserialize, Default)]
779#[serde(rename_all = "camelCase")]
780pub struct GetInterestGroupDetailsParams {
781
782    pub ownerOrigin: String,
783
784    pub name: String,
785}
786
787/// Gets details for a named interest group.
788
789#[derive(Debug, Clone, Serialize, Deserialize, Default)]
790#[serde(rename_all = "camelCase")]
791pub struct GetInterestGroupDetailsReturns {
792    /// This largely corresponds to:
793    /// https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup
794    /// but has absolute expirationTime instead of relative lifetimeMs and
795    /// also adds joiningOrigin.
796
797    pub details: serde_json::Map<String, JsonValue>,
798}
799
800impl GetInterestGroupDetailsParams { pub const METHOD: &'static str = "Storage.getInterestGroupDetails"; }
801
802impl crate::CdpCommand for GetInterestGroupDetailsParams {
803    const METHOD: &'static str = "Storage.getInterestGroupDetails";
804    type Response = GetInterestGroupDetailsReturns;
805}
806
807/// Enables/Disables issuing of interestGroupAccessed events.
808
809#[derive(Debug, Clone, Serialize, Deserialize, Default)]
810#[serde(rename_all = "camelCase")]
811pub struct SetInterestGroupTrackingParams {
812
813    pub enable: bool,
814}
815
816impl SetInterestGroupTrackingParams { pub const METHOD: &'static str = "Storage.setInterestGroupTracking"; }
817
818impl crate::CdpCommand for SetInterestGroupTrackingParams {
819    const METHOD: &'static str = "Storage.setInterestGroupTracking";
820    type Response = crate::EmptyReturns;
821}
822
823/// Enables/Disables issuing of interestGroupAuctionEventOccurred and
824/// interestGroupAuctionNetworkRequestCreated.
825
826#[derive(Debug, Clone, Serialize, Deserialize, Default)]
827#[serde(rename_all = "camelCase")]
828pub struct SetInterestGroupAuctionTrackingParams {
829
830    pub enable: bool,
831}
832
833impl SetInterestGroupAuctionTrackingParams { pub const METHOD: &'static str = "Storage.setInterestGroupAuctionTracking"; }
834
835impl crate::CdpCommand for SetInterestGroupAuctionTrackingParams {
836    const METHOD: &'static str = "Storage.setInterestGroupAuctionTracking";
837    type Response = crate::EmptyReturns;
838}
839
840/// Gets metadata for an origin's shared storage.
841
842#[derive(Debug, Clone, Serialize, Deserialize, Default)]
843#[serde(rename_all = "camelCase")]
844pub struct GetSharedStorageMetadataParams {
845
846    pub ownerOrigin: String,
847}
848
849/// Gets metadata for an origin's shared storage.
850
851#[derive(Debug, Clone, Serialize, Deserialize, Default)]
852#[serde(rename_all = "camelCase")]
853pub struct GetSharedStorageMetadataReturns {
854
855    pub metadata: SharedStorageMetadata,
856}
857
858impl GetSharedStorageMetadataParams { pub const METHOD: &'static str = "Storage.getSharedStorageMetadata"; }
859
860impl crate::CdpCommand for GetSharedStorageMetadataParams {
861    const METHOD: &'static str = "Storage.getSharedStorageMetadata";
862    type Response = GetSharedStorageMetadataReturns;
863}
864
865/// Gets the entries in an given origin's shared storage.
866
867#[derive(Debug, Clone, Serialize, Deserialize, Default)]
868#[serde(rename_all = "camelCase")]
869pub struct GetSharedStorageEntriesParams {
870
871    pub ownerOrigin: String,
872}
873
874/// Gets the entries in an given origin's shared storage.
875
876#[derive(Debug, Clone, Serialize, Deserialize, Default)]
877#[serde(rename_all = "camelCase")]
878pub struct GetSharedStorageEntriesReturns {
879
880    pub entries: Vec<SharedStorageEntry>,
881}
882
883impl GetSharedStorageEntriesParams { pub const METHOD: &'static str = "Storage.getSharedStorageEntries"; }
884
885impl crate::CdpCommand for GetSharedStorageEntriesParams {
886    const METHOD: &'static str = "Storage.getSharedStorageEntries";
887    type Response = GetSharedStorageEntriesReturns;
888}
889
890/// Sets entry with 'key' and 'value' for a given origin's shared storage.
891
892#[derive(Debug, Clone, Serialize, Deserialize, Default)]
893#[serde(rename_all = "camelCase")]
894pub struct SetSharedStorageEntryParams {
895
896    pub ownerOrigin: String,
897
898    pub key: String,
899
900    pub value: String,
901    /// If 'ignoreIfPresent' is included and true, then only sets the entry if
902    /// 'key' doesn't already exist.
903
904    #[serde(skip_serializing_if = "Option::is_none")]
905    pub ignoreIfPresent: Option<bool>,
906}
907
908impl SetSharedStorageEntryParams { pub const METHOD: &'static str = "Storage.setSharedStorageEntry"; }
909
910impl crate::CdpCommand for SetSharedStorageEntryParams {
911    const METHOD: &'static str = "Storage.setSharedStorageEntry";
912    type Response = crate::EmptyReturns;
913}
914
915/// Deletes entry for 'key' (if it exists) for a given origin's shared storage.
916
917#[derive(Debug, Clone, Serialize, Deserialize, Default)]
918#[serde(rename_all = "camelCase")]
919pub struct DeleteSharedStorageEntryParams {
920
921    pub ownerOrigin: String,
922
923    pub key: String,
924}
925
926impl DeleteSharedStorageEntryParams { pub const METHOD: &'static str = "Storage.deleteSharedStorageEntry"; }
927
928impl crate::CdpCommand for DeleteSharedStorageEntryParams {
929    const METHOD: &'static str = "Storage.deleteSharedStorageEntry";
930    type Response = crate::EmptyReturns;
931}
932
933/// Clears all entries for a given origin's shared storage.
934
935#[derive(Debug, Clone, Serialize, Deserialize, Default)]
936#[serde(rename_all = "camelCase")]
937pub struct ClearSharedStorageEntriesParams {
938
939    pub ownerOrigin: String,
940}
941
942impl ClearSharedStorageEntriesParams { pub const METHOD: &'static str = "Storage.clearSharedStorageEntries"; }
943
944impl crate::CdpCommand for ClearSharedStorageEntriesParams {
945    const METHOD: &'static str = "Storage.clearSharedStorageEntries";
946    type Response = crate::EmptyReturns;
947}
948
949/// Resets the budget for 'ownerOrigin' by clearing all budget withdrawals.
950
951#[derive(Debug, Clone, Serialize, Deserialize, Default)]
952#[serde(rename_all = "camelCase")]
953pub struct ResetSharedStorageBudgetParams {
954
955    pub ownerOrigin: String,
956}
957
958impl ResetSharedStorageBudgetParams { pub const METHOD: &'static str = "Storage.resetSharedStorageBudget"; }
959
960impl crate::CdpCommand for ResetSharedStorageBudgetParams {
961    const METHOD: &'static str = "Storage.resetSharedStorageBudget";
962    type Response = crate::EmptyReturns;
963}
964
965/// Enables/disables issuing of sharedStorageAccessed events.
966
967#[derive(Debug, Clone, Serialize, Deserialize, Default)]
968#[serde(rename_all = "camelCase")]
969pub struct SetSharedStorageTrackingParams {
970
971    pub enable: bool,
972}
973
974impl SetSharedStorageTrackingParams { pub const METHOD: &'static str = "Storage.setSharedStorageTracking"; }
975
976impl crate::CdpCommand for SetSharedStorageTrackingParams {
977    const METHOD: &'static str = "Storage.setSharedStorageTracking";
978    type Response = crate::EmptyReturns;
979}
980
981/// Set tracking for a storage key's buckets.
982
983#[derive(Debug, Clone, Serialize, Deserialize, Default)]
984#[serde(rename_all = "camelCase")]
985pub struct SetStorageBucketTrackingParams {
986
987    pub storageKey: String,
988
989    pub enable: bool,
990}
991
992impl SetStorageBucketTrackingParams { pub const METHOD: &'static str = "Storage.setStorageBucketTracking"; }
993
994impl crate::CdpCommand for SetStorageBucketTrackingParams {
995    const METHOD: &'static str = "Storage.setStorageBucketTracking";
996    type Response = crate::EmptyReturns;
997}
998
999/// Deletes the Storage Bucket with the given storage key and bucket name.
1000
1001#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1002#[serde(rename_all = "camelCase")]
1003pub struct DeleteStorageBucketParams {
1004
1005    pub bucket: StorageBucket,
1006}
1007
1008impl DeleteStorageBucketParams { pub const METHOD: &'static str = "Storage.deleteStorageBucket"; }
1009
1010impl crate::CdpCommand for DeleteStorageBucketParams {
1011    const METHOD: &'static str = "Storage.deleteStorageBucket";
1012    type Response = crate::EmptyReturns;
1013}
1014
1015/// Deletes state for sites identified as potential bounce trackers, immediately.
1016
1017#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1018#[serde(rename_all = "camelCase")]
1019pub struct RunBounceTrackingMitigationsReturns {
1020
1021    pub deletedSites: Vec<String>,
1022}
1023
1024#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1025pub struct RunBounceTrackingMitigationsParams {}
1026
1027impl RunBounceTrackingMitigationsParams { pub const METHOD: &'static str = "Storage.runBounceTrackingMitigations"; }
1028
1029impl crate::CdpCommand for RunBounceTrackingMitigationsParams {
1030    const METHOD: &'static str = "Storage.runBounceTrackingMitigations";
1031    type Response = RunBounceTrackingMitigationsReturns;
1032}
1033
1034/// Returns the effective Related Website Sets in use by this profile for the browser
1035/// session. The effective Related Website Sets will not change during a browser session.
1036
1037#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1038#[serde(rename_all = "camelCase")]
1039pub struct GetRelatedWebsiteSetsReturns {
1040
1041    pub sets: Vec<RelatedWebsiteSet>,
1042}
1043
1044#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1045pub struct GetRelatedWebsiteSetsParams {}
1046
1047impl GetRelatedWebsiteSetsParams { pub const METHOD: &'static str = "Storage.getRelatedWebsiteSets"; }
1048
1049impl crate::CdpCommand for GetRelatedWebsiteSetsParams {
1050    const METHOD: &'static str = "Storage.getRelatedWebsiteSets";
1051    type Response = GetRelatedWebsiteSetsReturns;
1052}
1053
1054
1055#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1056#[serde(rename_all = "camelCase")]
1057pub struct SetProtectedAudienceKAnonymityParams {
1058
1059    pub owner: String,
1060
1061    pub name: String,
1062
1063    pub hashes: Vec<String>,
1064}
1065
1066impl SetProtectedAudienceKAnonymityParams { pub const METHOD: &'static str = "Storage.setProtectedAudienceKAnonymity"; }
1067
1068impl crate::CdpCommand for SetProtectedAudienceKAnonymityParams {
1069    const METHOD: &'static str = "Storage.setProtectedAudienceKAnonymity";
1070    type Response = crate::EmptyReturns;
1071}