{
  "title": "IMJ UI Semantic Catalog",
  "type": "object",
  "required": ["schemaVersion", "entries"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" },
    "entries": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/semanticEntry" }
    }
  },
  "$defs": {
    "classification": {
      "type": "string",
      "enum": [
        "DataRegistry",
        "Configuration",
        "AuditLog",
        "WorkflowProcess",
        "TimelineEntity",
        "MasterList",
        "NotificationFeed",
        "FilterBar",
        "FormEntity",
        "DateField"
      ]
    },
    "capability": {
      "type": "string",
      "enum": [
        "search",
        "pagination",
        "advancedFilter",
        "export",
        "selection",
        "stateTracking",
        "timeline",
        "dragDrop",
        "formFields",
        "dateRange",
        "notification"
      ]
    },
    "dataBinding": {
      "type": "object",
      "required": ["kind"],
      "properties": {
        "kind": { "type": "string", "enum": ["rest", "stateMachine", "static", "composition"] },
        "rowsProp": { "type": "string" },
        "columnsProp": { "type": "string" },
        "toolbarSearchProp": { "type": "string" },
        "paginationProp": { "type": "string" },
        "stateField": { "type": ["string", "null"] },
        "lifecycleToColumn": { "type": "boolean" },
        "valueProp": { "type": "string" },
        "itemsProp": { "type": "string" },
        "filtersProp": { "type": "string" },
        "compositionModules": {
          "type": "array",
          "items": { "type": "string" }
        }
      },
      "additionalProperties": false
    },
    "entityHints": {
      "type": "object",
      "properties": {
        "preferredKeyFields": {
          "type": "array",
          "items": { "type": "string" }
        },
        "statusFieldCandidates": {
          "type": "array",
          "items": { "type": "string" }
        }
      },
      "additionalProperties": false
    },
    "semanticEntry": {
      "type": "object",
      "required": [
        "id",
        "moduleId",
        "exportName",
        "displayName",
        "importPath",
        "importSymbol",
        "semantic",
        "dataBinding"
      ],
      "additionalProperties": false,
      "properties": {
        "id": { "type": "string", "minLength": 1 },
        "moduleId": { "type": "string", "minLength": 1 },
        "exportName": { "type": "string", "minLength": 1 },
        "displayName": { "type": "string", "minLength": 1 },
        "importPath": { "type": "string", "const": "@imj_media/ui" },
        "importSymbol": { "type": "string", "minLength": 1 },
        "replacesGeneric": {
          "type": "array",
          "items": { "type": "string" }
        },
        "semantic": {
          "type": "object",
          "required": ["classification", "capabilities"],
          "properties": {
            "classification": {
              "type": "array",
              "items": { "$ref": "#/$defs/classification" },
              "minItems": 1
            },
            "capabilities": {
              "type": "array",
              "items": { "$ref": "#/$defs/capability" }
            }
          },
          "additionalProperties": false
        },
        "dataBinding": { "$ref": "#/$defs/dataBinding" },
        "entityHints": { "$ref": "#/$defs/entityHints" },
        "limitations": {
          "type": "array",
          "items": { "type": "string" }
        }
      }
    }
  }
}
