{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brixsignage-com/json-schema/brixsignage-com-manifest-preview-schema.json",
  "title": "ManifestPreview",
  "description": "What the screen would play: the player manifest, built as the device would receive it.",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brixsignage-com-openapi.json#/components/schemas/ManifestPreview",
  "type": "object",
  "properties": {
    "v": {
      "type": "integer",
      "description": "Manifest format version."
    },
    "screen": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "rotation": {
          "type": "integer"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "id",
        "name",
        "rotation",
        "tags"
      ]
    },
    "generatedAt": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "minPlayerVersion": {
      "type": "string"
    },
    "content": {
      "$ref": "#/$defs/ManifestContentBlock"
    },
    "standbyContent": {
      "description": "Shown while the panel is outside its operating hours, when set.",
      "$ref": "#/$defs/ManifestContentBlock"
    },
    "screensOff": {
      "description": "True when the rules say the panel should be off now.",
      "type": "boolean"
    },
    "operatingWindow": {
      "description": "Weekly on-hours by weekday key (`mon`…`sun`), or null for always on.",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "windows": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "start": {
                        "type": "string"
                      },
                      "end": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "start",
                      "end"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "timeZone": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "windows",
            "timeZone"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "proofOfPlay": {
      "type": "boolean"
    },
    "dooh": {
      "description": "True when the workspace has advertising on. Players ignore ad pods when this is false.",
      "type": "boolean"
    },
    "playbackMode": {
      "type": "string",
      "enum": [
        "sync",
        "unsync",
        "device-time"
      ]
    },
    "clock": {
      "type": "object",
      "properties": {
        "timeZone": {
          "type": "string"
        }
      },
      "required": [
        "timeZone"
      ]
    },
    "language": {
      "type": "string"
    },
    "location": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "label": {
              "type": "string"
            },
            "lat": {
              "type": "number"
            },
            "lng": {
              "type": "number"
            }
          },
          "required": [
            "label",
            "lat",
            "lng"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "playerSettings": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {},
      "description": "Effective player settings (volume, watermark, download policy, …)."
    },
    "watermarkText": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "accountHold": {
      "description": "Present when the account is on hold: the screen shows a hold card, not content.",
      "type": "object",
      "properties": {
        "status": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "reason"
      ]
    },
    "kiosk": {
      "description": "Screen Lock. The device's PIN material is never returned here — only whether it is set.",
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "graceSeconds": {
          "type": "integer"
        },
        "hasPin": {
          "type": "boolean"
        },
        "hasRecovery": {
          "type": "boolean"
        }
      },
      "required": [
        "enabled",
        "graceSeconds",
        "hasPin",
        "hasRecovery"
      ]
    },
    "apkUpdatePolicy": {
      "type": "object",
      "properties": {
        "window": {
          "type": "boolean"
        },
        "hourLocal": {
          "type": "integer"
        },
        "forceAfterDays": {
          "type": "integer"
        },
        "windowMinutes": {
          "type": "integer"
        },
        "force": {
          "type": "boolean"
        }
      },
      "required": [
        "window",
        "hourLocal",
        "forceAfterDays",
        "windowMinutes",
        "force"
      ]
    },
    "apkUpdate": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "sha256": {
          "type": "string"
        },
        "signature": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "version",
        "url",
        "sha256"
      ]
    },
    "testMode": {
      "type": "boolean",
      "const": true
    },
    "testEligible": {
      "type": "boolean",
      "const": true
    },
    "flightRecorder": {
      "type": "object",
      "properties": {
        "sampleMs": {
          "type": "number"
        },
        "maxEdge": {
          "type": "number"
        },
        "quality": {
          "type": "number"
        }
      },
      "required": [
        "sampleMs",
        "maxEdge",
        "quality"
      ]
    },
    "mediaBenchClipUrl": {
      "description": "A short public clip the player decodes off-screen for its media self-test. Absent unless configured.",
      "type": "string"
    },
    "fonts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "family": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "weights": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        },
        "required": [
          "family",
          "url",
          "weights"
        ]
      }
    },
    "upcomingBlocks": {
      "description": "The next scheduled changes, so an offline device can pre-load them.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "activatesAt": {
            "type": "string",
            "description": "ISO-8601 timestamp (UTC)."
          },
          "content": {
            "$ref": "#/$defs/ManifestContentBlock"
          },
          "screensOff": {
            "type": "boolean"
          }
        },
        "required": [
          "activatesAt",
          "content"
        ]
      }
    },
    "retiredMediaIds": {
      "description": "Media this workspace deleted from its library in the last 30 days (newest first, at most 200). The device deletes its stored copies. Absent when there are none.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "nextRefreshAt": {
      "type": "string",
      "description": "ISO-8601 timestamp (UTC)."
    },
    "prestagedOverrides": {
      "description": "Emergency templates pre-loaded on the device.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "emergency",
              "cast"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ]
          },
          "headline": {
            "type": "string"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "content": {
            "$ref": "#/$defs/ManifestContentBlock"
          },
          "triggeredAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO-8601 timestamp (UTC)."
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO-8601 timestamp (UTC)."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "severity",
          "headline",
          "body",
          "content",
          "triggeredAt",
          "expiresAt"
        ]
      }
    },
    "cast": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "emergency",
            "cast"
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "critical"
          ]
        },
        "headline": {
          "type": "string"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "content": {
          "$ref": "#/$defs/ManifestContentBlock"
        },
        "triggeredAt": {
          "anyOf": [
            {
              "type": "string",
              "description": "ISO-8601 timestamp (UTC)."
            },
            {
              "type": "null"
            }
          ]
        },
        "expiresAt": {
          "anyOf": [
            {
              "type": "string",
              "description": "ISO-8601 timestamp (UTC)."
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "kind",
        "severity",
        "headline",
        "body",
        "content",
        "triggeredAt",
        "expiresAt"
      ]
    },
    "emergency": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "emergency",
            "cast"
          ]
        },
        "severity": {
          "type": "string",
          "enum": [
            "info",
            "warning",
            "critical"
          ]
        },
        "headline": {
          "type": "string"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "content": {
          "$ref": "#/$defs/ManifestContentBlock"
        },
        "triggeredAt": {
          "anyOf": [
            {
              "type": "string",
              "description": "ISO-8601 timestamp (UTC)."
            },
            {
              "type": "null"
            }
          ]
        },
        "expiresAt": {
          "anyOf": [
            {
              "type": "string",
              "description": "ISO-8601 timestamp (UTC)."
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "kind",
        "severity",
        "headline",
        "body",
        "content",
        "triggeredAt",
        "expiresAt"
      ]
    },
    "sealed": {
      "type": "boolean",
      "const": true
    },
    "brand": {
      "type": "object",
      "properties": {
        "partnerId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "productName": {
          "type": "string"
        },
        "logoUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "brandColor": {
          "type": "string"
        },
        "cmsHost": {
          "type": "string"
        },
        "supportEmail": {
          "type": "string"
        },
        "termsUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "privacyUrl": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "isWhiteLabel": {
          "type": "boolean"
        }
      },
      "required": [
        "partnerId",
        "productName",
        "logoUrl",
        "brandColor",
        "cmsHost",
        "supportEmail",
        "termsUrl",
        "privacyUrl",
        "isWhiteLabel"
      ]
    }
  },
  "required": [
    "v",
    "screen",
    "generatedAt",
    "minPlayerVersion",
    "content",
    "playbackMode",
    "language",
    "location",
    "playerSettings"
  ],
  "$defs": {
    "ManifestContentBlock": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "none",
            "creative",
            "signage",
            "playlist",
            "app",
            "media",
            "layout"
          ]
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": {},
      "description": "Resolved content: `kind` plus the fields for that kind (`media`, `playlist` + `items`, `app`, `layout` + `zones`, `creative`, `signage`). The inner shape is the player's format and grows with it."
    }
  }
}