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 general widget in one of the back-office platforms
message BackOfficeWidget {
  // Platform that hosts the widget.
  //
  // Must be `"BUSINESS_MANAGER"`.
  BackOfficeHostingPlatforms hosting_platform = 1 [(wix.api.field_exposure) = INTERNAL];
  // Widget render content
  oneof content {
    // Iframe URL that hosts the widget's content.
    string iframe_url = 2 [(wix.api.format) = WEB_URL];
    BackOfficeScriptAsset script_asset = 3 [(wix.api.field_exposure) = INTERNAL];
  }
  // Widget title.
  string title = 4 [(.wix.api.minLength) = 1, (wix.api.translatable) = {
    type: SHORT_TEXT
    grouping: "title"
  }];
  // Required permission to view this widget
  string required_permission = 5 [(wix.api.field_exposure) = INTERNAL];
  // Sentry error reporting DSN
  ErrorReporting error_reporting = 6 [(wix.api.field_exposure) = INTERNAL];
  // Initial width of the widget while loading, in pixels.
  // Width may be adjusted dynamically based on the content of the widget or limited by the size of the widget's container.
  google.protobuf.Int32Value width = 7 [(wix.api.min) = 0, (wix.api.max) = 9999];
  // Initial height of the widget while loading, in pixels.
  // Height may be adjusted dynamically based on the content of the widget or limited by the size of the widget's container.
  google.protobuf.Int32Value height = 9 [(wix.api.min) = 0, (wix.api.max) = 9999];

  // The list of slot ids available
  repeated string slot_ids = 10 [(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
  ExtensionExposure exposure_and_maturity = 11 [(.wix.api.field_exposure) = INTERNAL]; 
}
