{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://p-hatan.com/deeplink-x/catalog.schema.json",
  "title": "DeeplinkX capability and page catalog, version 1",
  "type": "object",
  "required": [
    "schemaVersion",
    "inventoryState",
    "package",
    "semantics",
    "coreApi",
    "counts",
    "apps",
    "stores",
    "pages"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "inventoryState": {
      "enum": [
        "prospective-unpublished-preview",
        "published",
        "release-candidate"
      ]
    },
    "package": {
      "type": "object",
      "required": [
        "name",
        "version",
        "sourceCommit"
      ]
    },
    "semantics": {
      "type": "object",
      "description": "Launch, platform, fallback, and result behavior."
    },
    "coreApi": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "symbol",
          "signatureDart",
          "sourceRef"
        ]
      }
    },
    "counts": {
      "type": "object",
      "required": [
        "apps",
        "stores",
        "actions"
      ],
      "properties": {
        "apps": {
          "type": "integer",
          "minimum": 0
        },
        "stores": {
          "type": "integer",
          "minimum": 0
        },
        "actions": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "apps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/provider"
      }
    },
    "stores": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/provider"
      }
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "type",
          "title",
          "summary",
          "canonicalUrl",
          "publicationState",
          "sources"
        ]
      }
    }
  },
  "$defs": {
    "provider": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "displayName",
        "apiClass",
        "status",
        "declaredNativePlatforms",
        "canonicalUrl",
        "sourceRefs",
        "actions"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "canonicalUrl": {
          "type": "string",
          "format": "uri"
        },
        "declaredNativePlatforms": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "actions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "symbol",
              "signatureDart",
              "parameters",
              "declaredNativePlatforms",
              "webFallback",
              "supportsStoreFallbackFlag",
              "sourceRef",
              "canonicalUrl"
            ]
          }
        }
      }
    }
  }
}
