{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/produktly-com/json-schema/produktly-com-widget-stats-schema.json",
  "title": "WidgetStats",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/produktly-com-api-openapi.json#/components/schemas/WidgetStats",
  "type": "object",
  "properties": {
    "entityType": {
      "type": "string"
    },
    "period": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string"
        },
        "end": {
          "type": "string"
        }
      },
      "required": [
        "start",
        "end"
      ]
    },
    "widgets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "entityId": {
            "type": "integer"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "archivedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "events": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer"
                },
                "uniqueUsers": {
                  "type": "integer"
                }
              },
              "required": [
                "count",
                "uniqueUsers"
              ]
            }
          },
          "totalEvents": {
            "type": "integer"
          },
          "totalUniqueUsers": {
            "type": "integer"
          }
        },
        "required": [
          "entityId",
          "name",
          "archivedAt",
          "events",
          "totalEvents",
          "totalUniqueUsers"
        ]
      }
    }
  },
  "required": [
    "entityType",
    "period",
    "widgets"
  ]
}