tibi-types/schemas/api-config/dashboard.json
robin 7e01225447
All checks were successful
continuous-integration/drone/push Build is passing
final dashboard
2023-07-23 21:30:36 +00:00

358 lines
13 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"dashboard": {
"type": "object",
"properties": {
"majorItems": {
"type": "array",
"items": {
"oneOf": [
{ "$ref": "#/definitions/sectionTitle" },
{ "$ref": "#/definitions/swiper" },
{ "$ref": "#/definitions/graph" },
{ "$ref": "#/definitions/table" },
{ "$ref": "#/definitions/reference" }
]
}
},
"minorItems": {
"type": "array",
"items": { "$ref": "#/definitions/minorItem" }
}
}
}
},
"required": ["dashboard"],
"definitions": {
"sectionTitle": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["sectionTitle"] },
"title": { "type": "string" }
},
"required": ["type", "title"],
"additionalProperties": false
},
"swiper": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["swiper"] },
"class": { "type": "string" },
"css": {
"type": "object",
"properties": {
"graph": {
"type": "object",
"properties": {
"wrapper": {
"$ref": "#/definitions/cssWithEval"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"containerProps": { "$ref": "#/definitions/containerProps" },
"elements": {
"type": "array",
"items": { "$ref": "#/definitions/graph" }
}
},
"required": ["type", "elements"],
"additionalProperties": false
},
"comparison": {
"$ref": "#/definitions/graph"
},
"graph": {
"type": "object",
"properties": {
"additionalApiParams": {
"$ref": "#/definitions/additionalApiParams"
},
"class": { "type": "string" },
"type": { "type": "string", "enum": ["graph", "comparison"] },
"containerProps": { "$ref": "#/definitions/containerProps" },
"css": {
"type": "object",
"properties": {
"graph": {
"type": "object",
"properties": {
"wrapper": {
"$ref": "#/definitions/cssWithEval"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"title": {
"oneOf": [
{
"type": "object",
"properties": {
"value": { "type": "string" },
"contentAfter": { "type": "string" },
"contentBefore": { "type": "string" },
"eval": { "type": "string" }
},
"required": ["value"]
},
{ "type": "string" },
{
"type": "object",
"properties": {
"de": { "type": "string" },
"en": { "type": "string" }
},
"required": ["de", "en"]
}
]
},
"subTitle": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"properties": {
"de": { "type": "string" },
"en": { "type": "string" }
},
"required": ["de", "en"]
}
]
},
"xAxis": { "type": "string", "enum": ["timeline"] },
"timeInterval": {
"type": "string",
"enum": ["day", "month", "year"]
},
"filter": { "type": "boolean" },
"dateTimeField": { "type": "string" },
"until": {
"type": "string",
"enum": ["lastWeek", "lastMonth", "lastYear", "allTime"]
},
"graphType": {
"type": "string",
"enum": ["bar", "line", "pie", "donut", "area"]
},
"graphs": {
"type": "array",
"items": { "$ref": "#/definitions/graphDetail" }
},
"defaultUntil": {
"type": "string",
"enum": ["lastWeek", "lastMonth", "lastYear", "allTime"]
},
"newPageRef": { "type": "boolean" },
"limit": { "type": "number" },
"value": { "type": "string", "enum": ["total", "amount"] },
"valueType": {
"type": "string",
"enum": ["absolute", "relative"]
},
"field": { "type": "string" },
"path": { "type": "string" },
"style": {
"type": "object",
"properties": {
"upper": { "type": "string" },
"lower": { "type": "string" }
}
},
"collection": { "type": "string" },
"subNavigation": { "type": "number" },
"graphBaseColor": { "type": "string" },
"multipleYAxes": { "type": "boolean" },
"timespan": {
"type": "string",
"enum": ["YTD", "QTD", "MTD"]
},
"backgroundLines": { "type": "boolean" },
"opacity": { "type": "number" },
"elements": {
"type": "array",
"items": { "$ref": "#/definitions/graph" }
}
},
"additionalProperties": false
},
"graphDetail": {
"type": "object",
"properties": {
"graphName": {
"type": "object",
"properties": {
"de": { "type": "string" },
"en": { "type": "string" }
},
"required": ["de", "en"]
},
"graphType": {
"type": "string",
"enum": ["bar", "line", "pie", "donut", "area"]
},
"yAxisTitle": { "type": "string" },
"yAxis": {
"type": "string",
"enum": ["sum", "amount"]
},
"field": { "type": "string" }
},
"required": ["graphName"]
},
"table": {
"type": "object",
"properties": {
"containerProps": { "$ref": "#/definitions/containerProps" },
"type": { "type": "string", "enum": ["table"] },
"filter": { "type": "boolean" },
"collection": { "type": "string" },
"title": {
"oneOf": [
{
"type": "object",
"properties": {
"de": { "type": "string" },
"en": { "type": "string" }
},
"required": ["de", "en"]
},
{ "type": "string" }
]
},
"subTitle": {
"oneOf": [
{ "type": "string" },
{
"type": "object",
"properties": {
"de": { "type": "string" },
"en": { "type": "string" }
},
"required": ["de", "en"]
}
]
},
"columns": {
"type": "array",
"items": { "type": "string" }
},
"filterGroups": {
"type": "array",
"items": { "type": "string" }
},
"additionalApiParams": {
"$ref": "#/definitions/additionalApiParams"
}
},
"required": ["type"],
"additionalProperties": false
},
"reference": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["reference"] },
"newPageRef": { "type": "boolean" },
"collection": { "type": "string" },
"style": {
"type": "object",
"properties": {
"upper": { "type": "string" },
"lower": { "type": "string" }
}
},
"subNavigation": { "type": "number" }
},
"required": ["type"],
"additionalProperties": false
},
"minorItem": {
"type": "object",
"properties": {
"collection": { "type": "string" },
"subNavigation": { "type": "number" },
"newPageRef": { "type": "boolean" }
},
"required": ["collection"],
"additionalProperties": false
},
"containerProps": {
"type": "object",
"properties": {
"class": { "type": "string" },
"style": { "type": "string" },
"layout": {
"type": "object",
"properties": {
"breakBefore": { "type": "boolean" },
"breakAfter": { "type": "boolean" },
"size": {
"type": "object",
"properties": {
"default": { "type": "string" },
"small": { "type": "string" },
"large": { "type": "string" }
}
}
}
}
},
"additionalProperties": false
},
"additionalApiParams": {
"type": "object",
"properties": {
"offset": { "type": "number" },
"limit": { "type": "number" },
"sort": { "type": "string" },
"filter": { "type": "object", "additionalProperties": true },
"projection": { "type": "string" },
"count": { "type": "number", "enum": [1] }
},
"additionalProperties": false
},
"cssWithEval": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"eval": {
"type": "string"
}
},
"required": ["eval"],
"additionalProperties": false
},
{
"type": "object",
"patternProperties": {
"^[a-zA-Z_][a-zA-Z0-9_-]*$": {
"oneOf": [
{ "type": "string" },
{ "type": "number" }
]
}
},
"additionalProperties": false
}
]
}
}
}