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";

// A page in one of the back-office platforms
// flynt-disable deleted-field-enum-reserved
message BackOfficePage {
  // The platform this page is hosted on
  BackOfficeHostingPlatforms hosting_platform = 1 [(wix.api.field_exposure) = INTERNAL];
  // Page component information
  oneof asset {
    string iframe_url = 2 [(wix.api.format) = WEB_URL];
    BackOfficeScriptAsset script_asset = 3 [(wix.api.field_exposure) = INTERNAL];
  }
  // The route of the page, must be a valid URL path, relative to the app namespace or app id
  string route_path = 4;
  // Routes that redirect to this page, these paths should include the original path including the namespace or app id
  repeated string previous_route_paths = 5;
  // Page title, also used as sidebar entry label
  string title = 6 [(.wix.api.minLength) = 1, (wix.api.translatable) = {
    type: SHORT_TEXT
    grouping: "title"
  }];
  // False by default, if true, sidebar will be hidden when loading the page
  bool full_page = 7;
  // Required permission to view page. if subject is missing this permission, the page link will be hidden from the sidebar and a "no-permission-page" will be displayed when visiting the route
  string required_permission = 8 [(wix.api.field_exposure) = INTERNAL];
  // Optional: category this page belongs to
  google.protobuf.StringValue page_category_id = 9 [(wix.api.format) = GUID];
  // Should the page be shown or hidden in the sidebar, by default a link to the page will be shown
  bool hide_in_sidebar = 10;
  // Sidebar order within the category and app, lower priority means the page is earlier, by default priority is 0, meaning newer pages will appear first
  int32 priority = 11;
  // Which page is active in sidebar when this page is loaded
  google.protobuf.StringValue active_sidebar_page_id = 12 [(wix.api.format) = GUID];
  // Sentry error reporting DSN
  ErrorReporting error_reporting = 13 [(wix.api.field_exposure) = INTERNAL];
  // general component data
  ComponentMetaData meta_data = 14;
  // [Wix Design System icon](https://www.wix-pages.com/wix-design-system-employees/?path=/story/foundations-icons--icons).
  // Use the full size key. The icon will be rendered in an appropriate size.
  google.protobuf.StringValue icon_key = 15 [(wix.api.minLength) = 3, (wix.api.maxLength) = 50];
  // Anchors for direct navigation to specific sections of the page
  repeated PageAnchor page_anchors = 16 [(wix.api.maxSize) = 50]; 
  // The list of slot ids available
  repeated string slot_ids = 17 [(wix.api.field_exposure) = INTERNAL, (wix.api.format) = GUID, (.wix.api.maxSize) = 100, (.wix.api.referenced_entity) = "wix.devcenter.components.v1.component"];
  // Specifying the visibility level and maturity stage
  // flynt-disable renamed-field-breaking-change
  ExtensionExposure exposure_and_maturity = 18 [(.wix.api.field_exposure) = INTERNAL]; 
  // The exported name of the page route, used to reference this route externally.
  google.protobuf.StringValue exported_route_name = 19 [(wix.api.maxLength) = 100, (.wix.api.field_exposure) = INTERNAL];
  // Determines how the page layout is rendered.
  // Allowed values: "standard_view", "builder_view", "expanded_view", default: "standard_view".
  LayoutMode layout_mode = 20;
}


  
message PageAnchor {
  // A URL path relative to the page route for direct navigation to a specific section
  string relative_url = 1 [(wix.api.minLength) = 1, (wix.api.maxLength) = 100];
  // [Wix Design System icon](https://www.wix-pages.com/wix-design-system-employees/?path=/story/foundations-icons--icons).
  // Use the full size key. The icon will be rendered in an appropriate size.
  google.protobuf.StringValue icon_key = 2 [(wix.api.minLength) = 3, (wix.api.maxLength) = 50];
  // metadata for the page anchor
  AnchorMetaData meta_data = 3;
  // anchor ID
  string id = 4 [(wix.api.maxLength) = 50];
  // The exported name of the internal route, used to reference this route externally.
  google.protobuf.StringValue exported_route_name = 5 [(wix.api.maxLength) = 100, (.wix.api.field_exposure) = INTERNAL];
  // List of dynamic URL parameters
  repeated UrlParam url_params = 6 [(.wix.api.field_exposure) = INTERNAL, (wix.api.maxSize) = 50]; 
}

message UrlParam {
  // The name of the parameter
  string name = 1 [(wix.api.minLength) = 1, (wix.api.maxLength) = 100];
  // The description of the parameter
  string description = 2 [(wix.api.minLength) = 1, (wix.api.maxLength) = 200];
}

message AnchorMetaData {
  google.protobuf.StringValue title = 1 [(wix.api.translatable) = {
      type: SHORT_TEXT
      grouping: "subtitle"
  }, (wix.api.minLength) = 1, (wix.api.maxLength) = 200]; // anchor title
  google.protobuf.StringValue description = 2 [(wix.api.translatable) = {
      type: SHORT_TEXT
      grouping: "subtitle"
  }, (wix.api.minLength) = 1, (wix.api.maxLength) = 200]; // anchor description
  repeated Keywords keywords = 3 [(wix.api.maxSize) = 100]; // anchor keywords
}

enum LayoutMode {
  STANDARD_VIEW = 0;
  BUILDER_VIEW = 1;
  EXPANDED_VIEW = 2;
}

