//flynt-disable enum-value-upper-case
syntax = "proto3";

package com.wixpress.appservice.api;

import "wix/api/validations.proto";

option java_package = "com.wixpress.appservice.api.components";

message BrowserStorage {
    // The type of storage we are declaring 
    enum StorageType {
       UNKNOWN_STORAGE_TYPE = 0;
       // A [cookie](https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie) we store in the browser 
       COOKIE = 1;
       // A [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) item that persists across tabs in the domain
       LOCALSTORAGE = 2;
       // A [sessionStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) item for a specific tab in the domain
       SESSIONSTORAGE = 3;
       // An item in [IndexDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
       INDEXDB = 4;
    }

    // The category for EU and US Privacy Law classification 
    enum ConsentCategory {
        // This is an invalid value, you must classify your storage item.
        UNKNOWN_CATEGORY = 0;
        // Is required for your app to function and does not use the data to do any tracking.
        essential = 1;
        // Related to performanc and functional additions that are niceities but the app can work without.
        functional = 2;
        // Related to analytics and may including tracking sessions and vistors to the site.
        analytics = 3;
        // Related to advertising, upselling and marketing data collected to be used.
        advertising = 4;
    }

    enum StorageDomain {
        UNKNOWN_STORAGE_DOMAIN = 0;
        // Storing the values in the domain of the website the app is installed on 
        SITE_DOMAIN = 1;
        // Storing the values in the Wix Backoffice domain 
        WIX_DOMAIN = 2;
        // Storing the values as 3rd party in the application domain 
        APP_DOMAIN = 3;
    }

    // The type of browser storage used
    StorageType type = 1;
    // The name of the storage item in the browser (as can be seen in DEV Console) 
    string name = 2 [(.wix.api.maxLength) = 100];
    // A human friendly description of the storage item and what it is used for. 
    // > This is for allowing users to display consent pages on their sites with this information.
    string description = 3 [(.wix.api.minLength) = 10, (.wix.api.maxLength) = 500];
     
    // The consent category to which the storage item belongs. 
    // This defines when this storage item is allowed to be used in a visitor session.  
    // > This is legally important for complying with EU privacy law, so make sure to define this carefully.  
    ConsentCategory consent_category = 4;
    // Where this storage item will be set in the browser (User domain or the App domain)
    StorageDomain domain = 5;
}