{ "$schema": "http://json-schema.org/draft-06/schema#", "$id": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/BlockConfig.json", "type": "object", "title": "BlockConfig", "description": "BlockConfig determines the Block properties", "required": [ "name", "type", "configurations" ], "properties": { "name": { "$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockName" }, "type": { "$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockType" }, "configurations": { "type": "array", "minItems": 1, "maxItems": 100, "title": "Block configurations", "description": "Block configurations", "items": { "type": "object", "required": [ "version" ], "properties": { "version": { "$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BasicSemVer" }, "endpoint": { "type": "object", "required": [ "url", "method", "cachePolicy", "parameters", "ui" ], "properties": { "url": { "type": "string", "title": "Block http URL", "description": "The HTTP(S) address the CMS will call to retrieve the BlockJSON", "examples": ["http://my.domain.com/blockprovider/block"] }, "method": { "type": "string", "title": "block http method", "description": "Only GET and POST are supported right now", "enum": ["GET", "POST"], "examples": ["GET", "POST"] }, "cachePolicy": { "type": "string", "title": "Block cache policy", "description": "Defines the Block data cache policy : PURE (cache one hour), IMPURE (cache few minutes), IMPURE_WITHOUT_STALE (cache few minutes, and guarantees no outdated data), ENDLESS (cache indefinitely) or NO_CACHE (at your own risk)", "default": false, "examples": ["PURE", "IMPURE", "IMPURE_WITHOUT_STALE", "ENDLESS", "NO_CACHE"] }, "compliantWithLastModifiedHeader": { "type": "boolean", "title": "Block is compliant with lastModified header", "description": "Indicate if the block is compliant with the LastModified Header (leading to a 304 status)", "default": false }, "parameters": { "type": "array", "title": "The parameters needed to send a valid HTTP Block call.", "description": "Paramètres HTTP à positionner lors des appels au endpoint", "items": { "$ref": "http://swagger.io/v2/schema.json#/definitions/parameter" } }, "consumes": { "type": "array", "title": "A list of MIME types the API can consume.", "description": "A list of MIME types the API can consume. Only 'application/json' is supported right now.", "items": { "type": "string", "title": "MIME type", "description": "MIME type the API can consume" } }, "ui": { "$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/UISchema" } } }, "rpc": { "type": "object", "description" : "RPC defines admin a/o rendering endpoint (please contact Ouest France for further explanations on this feature)", "properties": { "view": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "title": "Block RPC view HTTP url", "description": "The HTTP(S) address the CMS will call to request the block view RPC endpoint", "examples": ["http://my.domain.com/blockprovider/block/rpc/view"] } } }, "admin": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "title": "Block RPC admin HTTP url", "description": "The HTTP(S) address the CMS will call to request the block admin RPC endpoint", "examples": [ "http://my.domain.com/blockprovider/block/rpc/admin" ] }, "hooks": { "type": "array", "uniqueItems": true, "minItems": 0, "maxItems": 10, "items": { "type": "string", "title": "Standard methods handled by the Block RPC endpoint", "description": "Standard methods handled by the Block RPC endpoint", "enum": ["$before-save","$after-save"], "examples": ["$before-save"] } } } } } }, "templates": { "type": "array", "items": { "type": "object", "required": [ "name", "engine", "source", "targetFormat", "position" ], "properties": { "name": { "type": "string", "title": "Template name", "description": "Template name (so users can differentiate templates in the front client)", "examples": [ "default", "christmas" ] }, "position": { "type": "string", "title": "Template position", "description": "The position where the CMS will render the block in the page. (placeholder value means the block must to be render in a page placeholder)", "enum": ["placeholder", "head-top", "head-bottom", "body-top", "body-bottom"] }, "engine": { "$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockTemplateEngine" }, "targetFormat": { "$ref": "https://raw.githubusercontent.com/Ouest-France/platform/master/packages/schemas/defs.json#/definitions/BlockTemplateTargetFormat" }, "source": { "type": "string", "title": "Template source", "description": "Inlined template content", "examples": [ "
Hello {{ name }}
" ] }, "assets": { "type": "object", "properties": { "sharedJs": { "type": "array", "items": { "title": "Shared JS assets", "description": "JS Library or shared JS in page", "type": "string" } }, "sharedCss": { "type": "array", "items": { "title": "Shared css assets", "description": "css Library or shared css in page", "type": "string" } }, "js": { "type": "array", "items": { "title": "Js assets", "description": "JS URL", "type": "string" } }, "css": { "type": "array", "items": { "title": "Css assets", "description": "CSS URL", "type": "string" } }, "fonts": { "type": "array", "items": { "title": "Fonts assets", "description": "Font URL", "type": "string" } }, "images": { "type": "array", "items": { "title": "Images assets", "description": "Image URL - this type of assets if deprecated - please do not use it", "type": "string" } } } } } } }, "external": { "type": "object", "required": [], "properties": { "data": { "type": "array", "items": { "type": "string", "title": "External parameter", "description" : "External parameter exposed by the Block (ie. exposed to the other Blocks of the page)" } }, "headers": { "type": "array", "items": { "type": "string", "title": "Header", "description": "Header to set in the HTTP Response (only managed by Site-typed Blocks)" } }, "head": { "type": "array", "items": { "type": "object", "title": "Head HTML tag", "description": "HTML Tag to position in the section of the page (only managed by Site-typed Blocks)", "properties": { "tag": { "type": "string", "title": "Tag", "description": "Tag name" }, "attributes": { "type": "string", "title": "Attributes", "description": "Attributes" } } } } } }, "documentation": { "type": "object", "properties": { "url": { "type": "string", "title": "Block documentation HTTP url", "description": "The HTTP(S) address of the block documentation", "examples": ["https://my.domain.com/documentation"] } } } } } } } }