{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://config-central.local/schemas/profile.schema.json", "title": "Config Central profile", "type": "object", "additionalProperties": false, "required": [ "schemaVersion", "name" ], "properties": { "$schema": { "type": "string" }, "schemaVersion": { "const": 1 }, "name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }, "description": { "type": "string" }, "packages": { "type": "array", "items": { "$ref": "#/$defs/package" }, "default": [] }, "configs": { "type": "array", "items": { "$ref": "#/$defs/config" }, "default": [] } }, "$defs": { "package": { "type": "object", "additionalProperties": false, "required": [ "id" ], "properties": { "id": { "type": "string", "minLength": 1 }, "source": { "type": "string", "minLength": 1, "default": "winget" }, "scope": { "enum": [ "user", "machine" ] }, "version": { "type": "string", "minLength": 1 }, "update": { "enum": [ "latest", "pinned", "install-only" ], "default": "latest" }, "enabled": { "type": "boolean", "default": true }, "provider": { "enum": [ "winget", "portable" ], "default": "winget" }, "url": { "type": "string", "pattern": "^https://[^\\s]+\\.zip(\\?[^\\s]*)?$" }, "sha256": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" }, "executable": { "type": "string", "pattern": "^[A-Za-z0-9_-][A-Za-z0-9._/-]*\\.exe$" } }, "allOf": [ { "if": { "properties": { "provider": { "const": "portable" } }, "required": [ "provider" ] }, "then": { "properties": { "id": { "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" }, "source": { "pattern": "^[a-z0-9][a-z0-9-]{0,63}$" }, "scope": { "const": "user" } }, "allOf": [ { "if": { "properties": { "enabled": { "const": false } }, "required": [ "enabled" ] }, "else": { "required": [ "version", "url", "sha256", "executable", "update" ], "properties": { "version": { "pattern": "^\\d+\\.\\d+(\\.\\d+){0,2}$" }, "update": { "enum": [ "pinned", "install-only" ] } } } } ] }, "else": { "not": { "anyOf": [ { "required": [ "url" ] }, { "required": [ "sha256" ] }, { "required": [ "executable" ] } ] } } } ] }, "config": { "type": "object", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }, "source": { "type": "string", "minLength": 1 }, "target": { "type": "string", "minLength": 1 }, "mode": { "enum": [ "copy", "ini-overlay", "registry", "hosts-block", "windows-sounds", "windows-power" ], "default": "copy" }, "requiresPackage": { "type": "string", "minLength": 1 }, "enabled": { "type": "boolean", "default": true } }, "allOf": [ { "if": { "properties": { "enabled": { "const": false } }, "required": [ "enabled" ] }, "then": {}, "else": { "required": [ "source", "target" ] } } ] } } }