syntax = "proto3";

package com.wixpress.appservice.api;


import "google/protobuf/wrappers.proto";
import "wix/api/annotations.proto";
import "wix/api/validations.proto";
import "components_catalog_common.proto";

// Create a collection of native Editor components that loads directly in the Editor DOM
message PlatfromComponentData {
    // Add interim support for HTTP methods before a bigger rewrite for Routers as a component
    enum HTTPMethod {
      UNKNOWN_METHOD = 0;
      GET = 1;
      POST = 2;
    }
    // Path to a Javascript file that Editor runs on app install
    google.protobuf.StringValue editor_script_url = 1 [(wix.api.format) = WEB_URL];
    // Path to a Javascript file that viewer runs for page components / widgets and applicative business logic
    google.protobuf.StringValue viewer_script_url = 2;
    // If true, components of the app wont be added to the editor (only run editor scripts)
    bool platform_only = 3;
    // If the viewer script should run in the Editor
    bool enable_in_editor = 4;
    // URL to get complex routing decisions at runtime from a platform app. Some spec can be seen here: https://docs.google.com/document/d/1t_3bl9vVMoPVm_I9Sx59LsVUPXi07gihGIg3-F7z8Q0/edit?ts=595512f6#heading=h.9ca9859ng5d
    google.protobuf.StringValue router_service_url = 5;
    // Path to a Javascript file that viewer runs for page components / widgets and applicative business logic. Includes verbose logs for Wix runtime.
    google.protobuf.StringValue viewer_verbose_script_url = 6 [(wix.api.format) = WEB_URL];
    // A map of string descriptor the app understands to a versioned URL topology value, can be an API or statics data. Example: `storesCartAPI: https://stores.com/api/v2/cart/
    map<string, string> base_urls = 7;
    // Used by DAC (gradual roll-out). A map of string descriptor the app understands to a template versioned URL topology value, Example: `storeCSSStuff: https://static.pararstorage.com/services/stores-css-stuff/<%=serviceVersion('your_artifact_id')%>/main.css
    map<string, string> base_urls_template = 9;
    // should be <%=serviceUrl('your_artifact_id', 'viewer_script_url_bundle_file')%>
    google.protobuf.StringValue viewer_script_url_template = 8;
    // If this component should be stretched in relation to a form factor (desktop, tablet, mobile)
    IsStretched is_stretched = 10;
    // Any margins this page should have in relation to a form factor (desktop, tablet, mobile)
    Margins margins = 11;
    // Any docking this page (horizontal / vertical) should have in relation to a form factor (desktop, tablet, mobile)
    Docking docking = 12;
    // The height of this page in relation to a form factor (desktop, tablet, mobile)
    Height height = 13;
    // The width of this page in relation to a form factor (desktop, tablet, mobile)
    Width width = 14;
    // Support adding application pages with preset data
    // Vertical endpoint that clones the data
    // https://docs.google.com/document/d/1pUp-d9vVMCTjDdQffBuwh1mBvQacQZy0n6nm2amCMV4/edit
    google.protobuf.StringValue clone_app_data_url = 15 [(wix.api.format) = WEB_URL];
    // False by default
    // If false, data is cloned per app
    // If true, the data is cloned per add component on component addition
    bool should_clone_data_per_component = 16;
    // Error reporting URL used to report errors at platform level,
    // and as fallback for pageOOI and widgetOOI error reporting
    ErrorReporting error_reporting = 17;
    // A concrete versioned URL of the translation template, contains `{language}` parameter in the path
    google.protobuf.StringValue editor_translation_url = 18 [(wix.api.format) = WEB_URL];
    // A version templated URL of the translation template, contains a <%=serviceVersion('your_artifact_id')%> template and a `{language}` template
    google.protobuf.StringValue editor_translation_url_template = 19;
    bool exclude_from_auto_revoke = 20;
    // Should be <%=serviceUrl('your_artifact_id', 'editor_script_url_bundle_file')%>, this will later be resolved to the right version in the context of the request, meaning, URL/Cookie overrides, Rollout version, Employee Preview version and override the version of editor_script_url.
    google.protobuf.StringValue editor_script_url_template = 21 [(wix.api.field_exposure) = INTERNAL];
    // dictates if the app has migrated to the new platform API
    bool migrated_to_new_platform_api = 22;
    // The HTTP Verb used to call the router, if not set will be POST 
    HTTPMethod router_http_method = 23;
}
