UNPKG

@burgan-tech/vnext-schema

Version:

JSON Schema definitions for vNext vNext Workflow components validation

385 lines 20 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://vnext.io/schemas/view-definition.schema.json", "title": "vNext View Definition", "description": "Schema for vNext View Component Definition JSON files (sys-views flow)", "type": "object", "required": [ "key", "version", "domain", "flow", "flowVersion", "tags", "attributes" ], "properties": { "$schema": { "type": "string", "description": "JSON Schema reference", "format": "uri" }, "key": { "type": "string", "description": "View key identifier", "pattern": "^[a-z0-9-]+$" }, "version": { "type": "string", "description": "Version in Major.Minor.Patch format", "pattern": "^\\d+\\.\\d+\\.\\d+$" }, "domain": { "type": "string", "description": "Domain identifier", "pattern": "^[a-z0-9-]+$" }, "flow": { "type": "string", "description": "Flow identifier for views", "const": "sys-views" }, "flowVersion": { "type": "string", "description": "Flow version", "pattern": "^\\d+\\.\\d+\\.\\d+$" }, "tags": { "type": "array", "description": "View tags", "items": { "type": "string" }, "minItems": 1 }, "_comment": { "type": "string", "description": "Comment about the view" }, "attributes": { "type": "object", "description": "View definition attributes", "required": [ "type", "content" ], "properties": { "type": { "type": "integer", "description": "View content type", "oneOf": [ { "const": 1, "description": "JSON content type" }, { "const": 2, "description": "HTML content type" }, { "const": 3, "description": "Markdown content type" } ] }, "content": { "type": "string", "description": "View content. Can be in JSON, HTML or Markdown format.", "minLength": 1 }, "labels": { "type": "array", "description": "Multi-language labels for view", "items": { "type": "object", "required": [ "label", "language" ], "properties": { "label": { "type": "string", "minLength": 1 }, "language": { "type": "string", "pattern": "^[a-z]{2}-[A-Z]{2}$", "examples": [ "en-US", "tr-TR", "de-DE" ] } } } }, "display": { "type": "string", "description": "View display mode", "oneOf": [ { "const": "full-page", "description": "Full page display" }, { "const": "popup", "description": "Popup/modal display" }, { "const": "bottom-sheet", "description": "Bottom sheet display" }, { "const": "top-sheet", "description": "Top sheet display" }, { "const": "drawer", "description": "Drawer/side menu display" }, { "const": "inline", "description": "Inline display within page" } ] }, "platformOverrides": { "anyOf": [ { "type": "object", "properties": { "android": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "integer", "description": "Content type of the View to be overridden in Android environment", "oneOf": [ { "const": 1, "description": "JSON content type" }, { "const": 2, "description": "HTML content type" }, { "const": 3, "description": "Markdown content type" } ] }, "content": { "type": "string", "description": "Content of the View to be overridden in Android environment. Can be in JSON, HTML or Markdown format.", "pattern": "^[a-zA-Z\\-]+$", "maxLength": 100, "examples": [ "core", "idm", "banking", "payment" ] }, "display": { "type": "string", "description": "Display type of the View.", "pattern": "^[a-z\\-]+$", "maxLength": 100, "examples": [ "full-page", "popup", "bottom-sheet", "inline" ] } }, "required": [ "content", "display" ], "additionalProperties": false, "examples": [ { "type": 1, "content": "{ \"widget\": \"MaterialCard\", \"title\": \"Android Profile\" }", "display": "full-page" }, { "type": 2, "content": "<div class=\"profile\">Android Profile</div>", "display": "inline" } ] }, { "type": "null" } ], "description": "View to be overridden in Android environment" }, "ios": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "integer", "description": "Content type of the View to be overridden in iOS environment", "oneOf": [ { "const": 1, "description": "JSON content type" }, { "const": 2, "description": "HTML content type" }, { "const": 3, "description": "Markdown content type" } ] }, "content": { "type": "string", "description": "Content of the View to be overridden in iOS environment. Can be in JSON, HTML or Markdown format.", "pattern": "^[a-zA-Z\\-]+$", "maxLength": 100, "examples": [ "core", "idm", "banking", "payment" ] }, "display": { "type": "string", "description": "Display type of the View.", "pattern": "^[a-z\\-]+$", "maxLength": 100, "examples": [ "full-page", "popup", "bottom-sheet", "inline" ] } }, "required": [ "content", "display" ], "additionalProperties": false, "examples": [ { "type": 1, "content": "{ \"widget\": \"MaterialCard\", \"title\": \"Ios Profile\" }", "display": "full-page" }, { "type": 2, "content": "<div class=\"profile\">Ios Profile</div>", "display": "inline" } ] }, { "type": "null" } ], "description": "View to be overridden in iOS environment" }, "web": { "anyOf": [ { "type": "object", "properties": { "type": { "type": "integer", "description": "Content type of the View to be overridden in Web environment", "oneOf": [ { "const": 1, "description": "JSON content type" }, { "const": 2, "description": "HTML content type" }, { "const": 3, "description": "Markdown content type" } ] }, "content": { "type": "string", "description": "Content of the View to be overridden in Web environment. Can be in JSON, HTML or Markdown format.", "pattern": "^[a-zA-Z\\-]+$", "maxLength": 100, "examples": [ "core", "idm", "banking", "payment" ] }, "display": { "type": "string", "description": "Display type of the View.", "pattern": "^[a-z\\-]+$", "maxLength": 100, "examples": [ "full-page", "popup", "bottom-sheet", "inline" ] } }, "required": [ "content", "display" ], "additionalProperties": false, "examples": [ { "type": 1, "content": "{ \"widget\": \"MaterialCard\", \"title\": \"Web Profile\" }", "display": "full-page" }, { "type": 2, "content": "<div class=\"profile\">Web Profile</div>", "display": "inline" } ] }, { "type": "null" } ], "description": "View to be overridden in Web environment" } }, "additionalProperties": false }, { "type": "null" } ], "description": "Views to be overridden on a platform basis" }, "_comment": { "type": "string", "description": "Comment about the view" } }, "additionalProperties": false } }, "additionalProperties": false }