import {JSONSchema7} from 'json-schema'; /** * This schema defines a card collection template for rendering cards in a list * style format. It provides an optional add button and configurable sections. */ export default { $id: 'https://schemas.coastapp.com/card/v1/list.json', $schema: 'http://json-schema.org/draft-07/schema', title: 'Card Collection List Template V1', type: 'object', additionalProperties: false, properties: { version: {type: 'string', enum: ['v1']}, slug: {type: 'string'}, title: {type: 'string', default: '{channel.name}'}, context: {type: 'string', enum: ['list']}, createButton: { type: 'object', title: 'Create Button', description: 'DEPRECATED as of 20200923. This is no longer used in the UI.', additionalProperties: false, properties: { title: {type: 'string', default: 'Create {channel.name}'}, position: {type: 'string', enum: ['top'], default: 'top'}, }, }, emptyState: {$ref: 'https://schemas.coastapp.com/card/v1/emptyState.json'}, taskOptions: {$ref: '#/definitions/taskOptions'}, sections: { type: 'array', items: { type: 'object', title: 'List Section', additionalProperties: false, properties: { selector: { $ref: 'https://schemas.coastapp.com/card/v1/selector.json', }, sortBy: {$ref: 'https://schemas.coastapp.com/card/v1/sortBy.json'}, title: {type: 'string'}, collapsible: {type: 'boolean', default: false}, initiallyCollapsed: {type: 'boolean', default: false}, cardBlocks: { $ref: 'https://schemas.coastapp.com/card/v1/blocks.json', }, emptyState: {$ref: 'https://schemas.coastapp.com/card/v1/emptyState.json'}, quickCreate: {$ref: 'https://schemas.coastapp.com/card/v1/quickCreate.json'}, cardTheme: {$ref: 'https://schemas.coastapp.com/card/v1/cardTheme.json'}, }, required: ['cardBlocks'], }, minItems: 1, }, }, required: ['version', 'sections', 'context'], definitions: { taskOptions: { title: 'Task List Options V1', type: 'object', additionalProperties: false, properties: { completedSelector: {$ref: 'https://schemas.coastapp.com/card/v1/selector.json'}, onCompleteActions: {$ref: 'https://schemas.coastapp.com/card/v1/actions.json'}, onIncompleteActions: {$ref: 'https://schemas.coastapp.com/card/v1/actions.json'}, }, required: ['completedSelector'], }, }, } as JSONSchema7;