{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract": {
      "type": "string",
      "const": "DomainCommandDefinition"
    },
    "commandName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "ownerRepo": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "displayName": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string"
    },
    "targetKinds": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "inputSchemaRef": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "outputSchemaRef": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "sensitiveInputPaths": {
      "maxItems": 64,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 512,
        "pattern": "^\\/.*"
      }
    },
    "sensitiveResultPaths": {
      "maxItems": 64,
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 512,
        "pattern": "^\\/.*"
      }
    },
    "requiredPermissionCodes": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "handlerRef": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "version": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "minLength": 1
            }
          ]
        },
        "ownerRepo": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "additionalProperties": false
    },
    "sideEffects": {
      "default": [],
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "data-write",
          "execution",
          "navigation",
          "notification",
          "external-call"
        ]
      }
    }
  },
  "required": [
    "contract",
    "commandName",
    "ownerRepo",
    "displayName",
    "targetKinds",
    "inputSchemaRef",
    "requiredPermissionCodes",
    "handlerRef",
    "sideEffects"
  ],
  "additionalProperties": false,
  "$id": "https://schemas.infmonkeys.com/contracts/domain-command-definition.schema.json",
  "title": "domain-command-definition"
}
