{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/toolaby-app/json-schema/toolaby-app-analytics-summary-schema.json",
  "title": "AnalyticsSummary",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/toolaby-app-openapi.json#/components/schemas/AnalyticsSummary",
  "type": "object",
  "properties": {
    "tool": {
      "type": "string"
    },
    "range": {
      "$ref": "#/$defs/AnalyticsRange"
    },
    "channel": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "app",
        "web",
        null
      ],
      "description": "The channel asked for, or `null` for both together."
    },
    "counting": {
      "type": "boolean",
      "description": "Whether Toolaby counts devices yet. Revenue is counted regardless."
    },
    "parts": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "enum": [
          "open",
          "locked",
          "off"
        ]
      }
    },
    "devices": {},
    "funnel": {},
    "revenue": {},
    "uninstalls": {}
  },
  "required": [
    "tool",
    "range",
    "channel",
    "counting",
    "parts"
  ],
  "$defs": {
    "AnalyticsRange": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        },
        "days": {
          "type": "integer"
        },
        "clamped": {
          "type": "boolean",
          "description": "Asked for further back than the plan sees, and given its furthest."
        }
      },
      "required": [
        "id",
        "from",
        "to",
        "days",
        "clamped"
      ]
    }
  }
}