{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://unpkg.com/better-supabase/schemas/config-policies-v1.json",
  "title": "better-supabase config policies",
  "description": "Output of `better-supabase config policies --json`: every policy a `@bsb access` tag renders.",
  "type": "object",
  "additionalProperties": false,
  "required": ["version", "policies"],
  "properties": {
    "version": { "const": 1 },
    "policies": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema",
          "table",
          "operation",
          "name",
          "key",
          "tenantColumn",
          "actorGuard"
        ],
        "properties": {
          "schema": { "type": "string" },
          "table": { "type": "string" },
          "operation": { "enum": ["read", "create", "update", "delete"] },
          "name": { "type": "string" },
          "key": { "type": "string" },
          "tenantColumn": { "type": "string" },
          "actorGuard": { "type": "boolean" }
        }
      }
    }
  }
}
