syntax = "proto3";

package com.wixpress.appservice.api;

import "google/protobuf/wrappers.proto";
import "google/protobuf/struct.proto";
import "components_catalog_data.proto";
import "com/wixpress/appservice/api/components_catalog_type.proto";
import "wix/api/annotations.proto";

// Component Catalog Entity
message ComponentCatalog {
  // Enum of Component Type
  ComponentType component_type = 1;
  // Component name *from proto comment*
  string name = 2;
  // Component description *from proto comment*
  string description = 3;
  // Exposed in Dev Center to Internal users (Wix employees) or to all users (Wix users) *from proto comment*
  Exposure exposure = 4;
  // Learn more link *from proto comment*
  string learn_more_link = 5;
  // Can be deleted
  bool deletable = 6;
  // Editable in Dev Center
  bool editable = 7;
  // Only one per app / multiple per app
  bool singular = 8;
  // if required approval before adding the component
  bool requires_approval = 9;
  // Present in Editor / Dashboard / Extension
  ComponentPresent component_present = 10;
}

enum Exposure {
  NONE_EXPOSURE = 0;
  PRIVATE_EXPOSURE = 1;
  INTERNAL_EXPOSURE = 2;
  PUBLIC_EXPOSURE = 3;
}

enum ComponentPresent {
  NONE_PRESENT = 0;
  EDITOR_PRESENT = 1;
  DASHBOARD_PRESENT = 2;
  EXTENSION_PRESENT = 3;
}

message GetComponentsCatalogResponse {
  repeated ComponentCatalog components_catalog = 1;
}

message CreateComponentCatalogRequest {
  ComponentCatalog component_catalog = 1;
}

message UpdateComponentCatalogRequest {
  ComponentCatalog component_catalog = 1;
}

message DeleteComponentCatalogRequest {
  ComponentType component_type = 1;
}
