UNPKG

@budibase/server

Version:
1,372 lines • 175 kB
{ "openapi": "3.1.0", "info": { "title": "Budibase API", "description": "The public API for Budibase apps and its services.", "version": "3.3.0" }, "servers": [ { "url": "https://budibase.app/api/public/v1", "description": "Budibase Cloud API", "variables": { "apiKey": { "default": "<user API key>", "description": "The API key of the user to assume for API call." }, "appId": { "default": "<App ID>", "description": "The ID of the app the calls will be executed within the context of, this should start with app_ (production) or app_dev (development)." } } } ], "components": { "parameters": { "appId": { "in": "header", "name": "x-budibase-app-id", "required": true, "description": "The ID of the app which this request is targeting.", "schema": { "default": "{{appId}}", "type": "string" } }, "appIdUrl": { "in": "path", "name": "appId", "required": true, "description": "The ID of the app which this request is targeting.", "schema": { "default": "{{appId}}", "type": "string" } }, "queryId": { "in": "path", "name": "queryId", "required": true, "description": "The ID of the query which this request is targeting.", "schema": { "type": "string" } }, "rowId": { "in": "path", "name": "rowId", "required": true, "description": "The ID of the row which this request is targeting.", "schema": { "type": "string" } }, "tableId": { "in": "path", "name": "tableId", "required": true, "description": "The ID of the table which this request is targeting.", "schema": { "type": "string" } }, "userId": { "in": "path", "name": "userId", "required": true, "description": "The ID of the user which this request is targeting.", "schema": { "type": "string" } }, "viewId": { "in": "path", "name": "viewId", "required": true, "description": "The ID of the view which this request is targeting.", "schema": { "type": "string" } }, "workspaceId": { "in": "path", "name": "workspaceId", "required": true, "description": "The ID of the workspace which this request is targeting.", "schema": { "default": "{{workspaceId}}", "type": "string" } } }, "examples": { "application": { "value": { "data": { "_id": "app_metadata", "appId": "app_dev_957b12f943d348faa61db7e18e088d0f", "version": "1.0.58-alpha.0", "name": "App name", "url": "/url", "tenantId": "default", "updatedAt": "2022-02-22T13:00:54.035Z", "createdAt": "2022-02-11T18:02:26.961Z", "status": "development" } } }, "applications": { "value": { "data": [ { "_id": "app_metadata", "appId": "app_dev_957b12f943d348faa61db7e18e088d0f", "version": "1.0.58-alpha.0", "name": "App name", "url": "/url", "tenantId": "default", "updatedAt": "2022-02-22T13:00:54.035Z", "createdAt": "2022-02-11T18:02:26.961Z", "status": "development" } ] } }, "workspace": { "value": { "data": { "_id": "app_metadata", "appId": "app_dev_957b12f943d348faa61db7e18e088d0f", "version": "1.0.58-alpha.0", "name": "App name", "url": "/url", "tenantId": "default", "updatedAt": "2022-02-22T13:00:54.035Z", "createdAt": "2022-02-11T18:02:26.961Z", "status": "development" } } }, "workspaces": { "value": { "data": [ { "_id": "app_metadata", "appId": "app_dev_957b12f943d348faa61db7e18e088d0f", "version": "1.0.58-alpha.0", "name": "App name", "url": "/url", "tenantId": "default", "updatedAt": "2022-02-22T13:00:54.035Z", "createdAt": "2022-02-11T18:02:26.961Z", "status": "development" } ] } }, "deploymentOutput": { "value": { "data": { "_id": "ef12381f934b4f129675cdbb76eff3c2", "status": "SUCCESS", "appUrl": "/app-url" } } }, "inputRow": { "value": { "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "type": "row", "tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "name": "Mike", "age": 30, "relationship": [ "ro_ta_..." ] } }, "row": { "value": { "data": { "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "type": "row", "tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "name": "Mike", "age": 30, "relationship": [ { "primaryDisplay": "Joe", "_id": "ro_ta_..." } ] } } }, "enrichedRow": { "value": { "data": { "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "name": "eg", "tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "type": "row", "relationship": [ { "_id": "ro_ta_users_us_8f3d717147d74d759d8cef5b6712062f", "name": "Joe", "tableId": "ta_users", "internal": [ { "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "primaryDisplay": "eg" } ] } ] } } }, "rows": { "value": { "data": [ { "_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4", "type": "row", "tableId": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "name": "Mike", "age": 30, "relationship": [ { "primaryDisplay": "Joe", "_id": "ro_ta_..." } ] } ], "hasNextPage": true, "bookmark": 10 } }, "table": { "value": { "data": { "_id": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "name": "People", "schema": { "name": { "type": "string", "name": "name" }, "age": { "type": "number", "name": "age" }, "relationship": { "type": "link", "name": "relationship", "tableId": "ta_...", "fieldName": "relatedColumn", "relationshipType": "many-to-many" } } } } }, "tables": { "value": { "data": [ { "_id": "ta_5b1649e42a5b41dea4ef7742a36a7a70", "name": "People", "schema": { "name": { "type": "string", "name": "name" }, "age": { "type": "number", "name": "age" }, "relationship": { "type": "link", "name": "relationship", "tableId": "ta_...", "fieldName": "relatedColumn", "relationshipType": "many-to-many" } } } ] } }, "query": { "value": { "data": { "_id": "query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e", "datasourceId": "datasource_plus_4d8be0c506b9465daf4bf84d890fdab6", "parameters": [], "fields": { "sql": "select * from persons" }, "queryVerb": "read", "name": "Help", "schema": { "personid": { "name": "personid", "type": "string" }, "lastname": { "name": "lastname", "type": "string" }, "firstname": { "name": "firstname", "type": "string" }, "address": { "name": "address", "type": "string" }, "city": { "name": "city", "type": "string" } }, "transformer": "return data", "readable": true } } }, "queries": { "value": { "data": [ { "_id": "query_datasource_plus_4d8be0c506b9465daf4bf84d890fdab6_454854487c574d45bc4029b1e153219e", "datasourceId": "datasource_plus_4d8be0c506b9465daf4bf84d890fdab6", "parameters": [], "fields": { "sql": "select * from persons" }, "queryVerb": "read", "name": "Help", "schema": { "personid": { "name": "personid", "type": "string" }, "lastname": { "name": "lastname", "type": "string" }, "firstname": { "name": "firstname", "type": "string" }, "address": { "name": "address", "type": "string" }, "city": { "name": "city", "type": "string" } }, "transformer": "return data", "readable": true } ] } }, "restResponse": { "value": { "data": [ { "value": "<html lang='en-GB'></html>" } ], "pagination": { "cursor": "2" }, "raw": "<html lang='en-GB'></html>", "headers": { "content-type": "text/html; charset=ISO-8859-1" } } }, "sqlResponse": { "value": { "data": [ { "personid": 1, "lastname": "Hughes", "firstname": "Mike", "address": "123 Fake Street", "city": "Belfast" }, { "personid": 2, "lastname": "Smith", "firstname": "John", "address": "64 Updown Road", "city": "Dublin" } ] } }, "user": { "value": { "data": { "_id": "us_693a73206518477283a8d5ae31103252", "email": "test@example.com", "roles": { "app_957b12f943d348faa61db7e18e088d0f": "BASIC" }, "builder": { "global": false }, "admin": { "global": true }, "tenantId": "default", "status": "active", "budibaseAccess": true, "csrfToken": "9c70291d-7137-48f9-9166-99ab5473a3d4", "userId": "us_693a73206518477283a8d5ae31103252", "roleId": "ADMIN", "role": { "_id": "ADMIN", "name": "Admin", "permissionId": "admin", "inherits": "POWER" } } } }, "users": { "value": { "data": [ { "_id": "us_693a73206518477283a8d5ae31103252", "email": "test@example.com", "roles": { "app_957b12f943d348faa61db7e18e088d0f": "BASIC" }, "builder": { "global": false }, "admin": { "global": true }, "tenantId": "default", "status": "active", "budibaseAccess": true, "csrfToken": "9c70291d-7137-48f9-9166-99ab5473a3d4", "userId": "us_693a73206518477283a8d5ae31103252", "roleId": "ADMIN", "role": { "_id": "ADMIN", "name": "Admin", "permissionId": "admin", "inherits": "POWER" } } ] } }, "metrics": { "value": "# HELP budibase_os_uptime Time in seconds that the host operating system has been up.\n# TYPE budibase_os_uptime counter\nbudibase_os_uptime 54958\n# HELP budibase_os_free_mem Bytes of memory free for usage on the host operating system.\n# TYPE budibase_os_free_mem gauge\nbudibase_os_free_mem 804507648\n# HELP budibase_os_total_mem Total bytes of memory on the host operating system.\n# TYPE budibase_os_total_mem gauge\nbudibase_os_total_mem 16742404096\n# HELP budibase_os_used_mem Total bytes of memory in use on the host operating system.\n# TYPE budibase_os_used_mem gauge\nbudibase_os_used_mem 15937896448\n# HELP budibase_os_load1 Host operating system load average.\n# TYPE budibase_os_load1 gauge\nbudibase_os_load1 1.91\n# HELP budibase_os_load5 Host operating system load average.\n# TYPE budibase_os_load5 gauge\nbudibase_os_load5 1.75\n# HELP budibase_os_load15 Host operating system load average.\n# TYPE budibase_os_load15 gauge\nbudibase_os_load15 1.56\n# HELP budibase_tenant_user_count The number of users created.\n# TYPE budibase_tenant_user_count gauge\nbudibase_tenant_user_count 1\n# HELP budibase_tenant_app_count The number of apps created by a user.\n# TYPE budibase_tenant_app_count gauge\nbudibase_tenant_app_count 2\n# HELP budibase_tenant_production_app_count The number of apps a user has published.\n# TYPE budibase_tenant_production_app_count gauge\nbudibase_tenant_production_app_count 1\n# HELP budibase_tenant_dev_app_count The number of apps a user has unpublished in development.\n# TYPE budibase_tenant_dev_app_count gauge\nbudibase_tenant_dev_app_count 1\n# HELP budibase_tenant_db_count The number of couchdb databases including global tables such as _users.\n# TYPE budibase_tenant_db_count gauge\nbudibase_tenant_db_count 3\n# HELP budibase_quota_usage_apps The number of apps created.\n# TYPE budibase_quota_usage_apps gauge\nbudibase_quota_usage_apps 1\n# HELP budibase_quota_limit_apps The limit on the number of apps that can be created.\n# TYPE budibase_quota_limit_apps gauge\nbudibase_quota_limit_apps 9007199254740991\n# HELP budibase_quota_usage_rows The number of database rows used from the quota.\n# TYPE budibase_quota_usage_rows gauge\nbudibase_quota_usage_rows 0\n# HELP budibase_quota_limit_rows The limit on the number of rows that can be created.\n# TYPE budibase_quota_limit_rows gauge\nbudibase_quota_limit_rows 9007199254740991\n# HELP budibase_quota_usage_plugins The number of plugins in use.\n# TYPE budibase_quota_usage_plugins gauge\nbudibase_quota_usage_plugins 0\n# HELP budibase_quota_limit_plugins The limit on the number of plugins that can be created.\n# TYPE budibase_quota_limit_plugins gauge\nbudibase_quota_limit_plugins 9007199254740991\n# HELP budibase_quota_usage_user_groups The number of user groups created.\n# TYPE budibase_quota_usage_user_groups gauge\nbudibase_quota_usage_user_groups 0\n# HELP budibase_quota_limit_user_groups The limit on the number of user groups that can be created.\n# TYPE budibase_quota_limit_user_groups gauge\nbudibase_quota_limit_user_groups 9007199254740991\n# HELP budibase_quota_usage_queries The number of queries used in the current month.\n# TYPE budibase_quota_usage_queries gauge\nbudibase_quota_usage_queries 0\n# HELP budibase_quota_limit_queries The limit on the number of queries for the current month.\n# TYPE budibase_quota_limit_queries gauge\nbudibase_quota_limit_queries 9007199254740991\n# HELP budibase_quota_usage_automations The number of automations used in the current month.\n# TYPE budibase_quota_usage_automations gauge\nbudibase_quota_usage_automations 0\n# HELP budibase_quota_limit_automations The limit on the number of automations that can be created.\n# TYPE budibase_quota_limit_automations gauge\nbudibase_quota_limit_automations 9007199254740991\n" }, "view": { "value": { "data": { "name": "peopleView", "tableId": "ta_896a325f7e8147d2a2cda93c5d236511", "schema": { "name": { "visible": true, "readonly": false, "order": 1, "width": 300 }, "age": { "visible": true, "readonly": true, "order": 2, "width": 200 }, "salary": { "visible": false, "readonly": false } }, "query": { "logicalOperator": "all", "onEmptyFilter": "none", "groups": [ { "logicalOperator": "any", "filters": [ { "operator": "string", "field": "name", "value": "John" }, { "operator": "range", "field": "age", "value": { "low": 18, "high": 100 } } ] } ] }, "primaryDisplay": "name" } } }, "views": { "value": { "data": [ { "name": "peopleView", "tableId": "ta_896a325f7e8147d2a2cda93c5d236511", "schema": { "name": { "visible": true, "readonly": false, "order": 1, "width": 300 }, "age": { "visible": true, "readonly": true, "order": 2, "width": 200 }, "salary": { "visible": false, "readonly": false } }, "query": { "logicalOperator": "all", "onEmptyFilter": "none", "groups": [ { "logicalOperator": "any", "filters": [ { "operator": "string", "field": "name", "value": "John" }, { "operator": "range", "field": "age", "value": { "low": 18, "high": 100 } } ] } ] }, "primaryDisplay": "name" } ] } } }, "securitySchemes": { "ApiKeyAuth": { "type": "apiKey", "in": "header", "name": "x-budibase-api-key", "description": "Your individual API key, this will provide access based on the configured RBAC settings of your user." } }, "schemas": { "application": { "type": "object", "properties": { "name": { "description": "The name of the app.", "type": "string" }, "url": { "description": "The URL by which the app is accessed, this must be URL encoded.", "type": "string" } }, "required": [ "name" ] }, "workspace": { "type": "object", "properties": { "name": { "description": "The name of the app.", "type": "string" }, "url": { "description": "The URL by which the app is accessed, this must be URL encoded.", "type": "string" } }, "required": [ "name" ] }, "applicationOutput": { "type": "object", "properties": { "data": { "type": "object", "properties": { "name": { "description": "The name of the app.", "type": "string" }, "url": { "description": "The URL by which the app is accessed, this must be URL encoded.", "type": "string" }, "_id": { "description": "The ID of the app.", "type": "string" }, "status": { "description": "The status of the app, stating it if is the development or published version.", "type": "string", "enum": [ "development", "published" ] }, "createdAt": { "description": "States when the app was created, will be constant. Stored in ISO format.", "type": "string" }, "updatedAt": { "description": "States the last time the app was updated - stored in ISO format.", "type": "string" }, "version": { "description": "States the version of the Budibase client this app is currently based on.", "type": "string" }, "tenantId": { "description": "In a multi-tenant environment this will state the tenant this app is within.", "type": "string" }, "lockedBy": { "description": "The user this app is currently being built by.", "type": "object" } }, "required": [ "_id", "name", "url", "status", "createdAt", "updatedAt", "version" ] } }, "required": [ "data" ] }, "workspaceOutput": { "type": "object", "properties": { "data": { "type": "object", "properties": { "name": { "description": "The name of the app.", "type": "string" }, "url": { "description": "The URL by which the app is accessed, this must be URL encoded.", "type": "string" }, "_id": { "description": "The ID of the app.", "type": "string" }, "status": { "description": "The status of the app, stating it if is the development or published version.", "type": "string", "enum": [ "development", "published" ] }, "createdAt": { "description": "States when the app was created, will be constant. Stored in ISO format.", "type": "string" }, "updatedAt": { "description": "States the last time the app was updated - stored in ISO format.", "type": "string" }, "version": { "description": "States the version of the Budibase client this app is currently based on.", "type": "string" }, "tenantId": { "description": "In a multi-tenant environment this will state the tenant this app is within.", "type": "string" }, "lockedBy": { "description": "The user this app is currently being built by.", "type": "object" } }, "required": [ "_id", "name", "url", "status", "createdAt", "updatedAt", "version" ] } }, "required": [ "data" ] }, "applicationSearch": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "name": { "description": "The name of the app.", "type": "string" }, "url": { "description": "The URL by which the app is accessed, this must be URL encoded.", "type": "string" }, "_id": { "description": "The ID of the app.", "type": "string" }, "status": { "description": "The status of the app, stating it if is the development or published version.", "type": "string", "enum": [ "development", "published" ] }, "createdAt": { "description": "States when the app was created, will be constant. Stored in ISO format.", "type": "string" }, "updatedAt": { "description": "States the last time the app was updated - stored in ISO format.", "type": "string" }, "version": { "description": "States the version of the Budibase client this app is currently based on.", "type": "string" }, "tenantId": { "description": "In a multi-tenant environment this will state the tenant this app is within.", "type": "string" }, "lockedBy": { "description": "The user this app is currently being built by.", "type": "object" } }, "required": [ "_id", "name", "url", "status", "createdAt", "updatedAt", "version" ] } } }, "required": [ "data" ] }, "workspaceSearch": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "name": { "description": "The name of the app.", "type": "string" }, "url": { "description": "The URL by which the app is accessed, this must be URL encoded.", "type": "string" }, "_id": { "description": "The ID of the app.", "type": "string" }, "status": { "description": "The status of the app, stating it if is the development or published version.", "type": "string", "enum": [ "development", "published" ] }, "createdAt": { "description": "States when the app was created, will be constant. Stored in ISO format.", "type": "string" }, "updatedAt": { "description": "States the last time the app was updated - stored in ISO format.", "type": "string" }, "version": { "description": "States the version of the Budibase client this app is currently based on.", "type": "string" }, "tenantId": { "description": "In a multi-tenant environment this will state the tenant this app is within.", "type": "string" }, "lockedBy": { "description": "The user this app is currently being built by.", "type": "object" } }, "required": [ "_id", "name", "url", "status", "createdAt", "updatedAt", "version" ] } } }, "required": [ "data" ] }, "deploymentOutput": { "type": "object", "properties": { "data": { "type": "object", "properties": { "_id": { "description": "The ID of the app.", "type": "string" }, "status": { "description": "Status of the deployment, whether it succeeded or failed", "type": "string", "enum": [ "SUCCESS", "FAILURE" ] }, "appUrl": { "description": "The URL of the published app", "type": "string" } }, "required": [ "_id", "status", "appUrl" ] } }, "required": [ "data" ] }, "appExport": { "type": "object", "properties": { "encryptPassword": { "description": "An optional password used to encrypt the export.", "type": "string" }, "excludeRows": { "description": "Set whether the internal table rows should be excluded from the export.", "type": "boolean" } }, "required": [ "encryptPassword", "excludeRows" ] }, "workspaceExport": { "type": "object", "properties": { "encryptPassword": { "description": "An optional password used to encrypt the export.", "type": "string" }, "excludeRows": { "description": "Set whether the internal table rows should be excluded from the export.", "type": "boolean" } }, "required": [ "encryptPassword", "excludeRows" ] }, "row": { "description": "The row to be created/updated, based on the table schema.", "type": "object", "additionalProperties": { "description": "Key value properties of any type, depending on the table schema." } }, "searchOutput": { "type": "object", "required": [ "data" ], "properties": { "data": { "description": "An array of rows, these will each contain an _id field which can be used to update or delete them.", "type": "array", "items": { "type": "object" } }, "bookmark": { "description": "If pagination in use, this should be provided.", "oneOf": [ { "type": "string" }, { "type": "integer" } ] }, "hasNextPage": { "description": "If pagination in use, this will determine if there is another page to fetch.", "type": "boolean" } } }, "rowOutput": { "type": "object", "properties": { "data": { "description": "The row to be created/updated, based on the table schema.", "type": "object", "additionalProperties": { "description": "Key value properties of any type, depending on the table schema." }, "properties": { "_id": { "description": "The ID of the row.", "type": "string" }, "tableId": { "description": "The ID of the table this row comes from.", "type": "string" } }, "required": [ "tableId", "_id" ] } }, "required": [ "data" ] }, "table": { "description": "The table to be created/updated.", "type": "object", "required": [ "name", "schema" ], "properties": { "name": { "description": "The name of the table.", "type": "string" }, "primaryDisplay": { "type": "string", "description": "The name of the column which should be used in relationship tags when relating to this table." }, "schema": { "type": "object", "additionalProperties": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "link" ], "description": "A relationship column." }, "constraints": { "type": "object", "description": "A constraint can be applied to the column which will be validated against when a row is saved.", "properties": { "type": { "type": "string" }, "presence": { "oneOf": [ { "type": "boolean", "description": "Defines whether the column is required or not." }, { "type": "object", "description": "Defines whether the column is required or not.", "properties": { "allowEmpty": { "type": "boolean", "description": "Defines whether the value is allowed to be empty or not." } } } ] }, "inclusion": { "type": "array", "description": "Defines the valid values for this column." } } }, "name": { "type": "string", "description": "The name of the column." }, "autocolumn": { "type": "boolean", "description": "Defines whether the column is automatically generated." }, "width": { "type": "number", "description": "Defines the width of the column in the data UI." }, "fieldName": { "type": "string", "description": "The name of the column which a relationship column is related to in another table." }, "tableId": { "type": "string", "description": "The ID of the table which a relationship column is related to." }, "relationshipType": { "type": "string", "enum": [ "one-to-many", "many-to-one", "many-to-many" ], "description": "Defines the type of relationship that this column will be used for." }, "through": { "type": "string", "description": "When using a SQL table that contains many to many relationships this defines the table the relationships are linked through." }, "foreignKey": { "type": "string", "description": "When using a SQL table that contains a one to many relationship this defines the foreign key." }, "throughFrom": { "type": "string", "description": "When using a SQL table that utilises a through table, this defines the primary key in the through table for this table." }, "throughTo": { "type": "string", "description": "When using a SQL table that utilises a through table, this defines the primary key in the through table for the related table." } } }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "formula" ], "description": "A formula column." }, "constraints": { "type": "object", "description": "A constraint can be applied to the column which will be validated against when a row is saved.", "properties": { "type": { "type": "string" }, "presence": { "oneOf": [ { "type": "boolean", "description": "Defines whether the column is required or not." }, { "type": "object", "description": "Defines whether the column is required or not.", "properties": { "allowEmpty": { "type": "boolean", "description": "Defines whether the value is allowed to be empty or not." } } } ] }, "inclusion": { "type": "array", "description": "Defines the valid values for this column." } } }, "name": { "type": "string", "description": "The name of the column." }, "autocolumn": { "type": "boolean", "description": "Defines whether the column is automatically generated." }, "width": { "type": "number", "description": "Defines the width of the column in the data UI." }, "formula": { "type": "string", "description": "Defines a Handlebars or JavaScript formula to use, note that Javascript formulas are expected to be provided in the base64 format." }, "formulaType": { "type": "string", "enum": [ "static", "dynamic" ], "description": "Defines whether this is a static or dynamic formula." } } }, { "type": "object", "properties": { "type": { "type": "string", "enum": [ "string", "longform", "options", "number", "boolean", "array", "datetime", "attachment", "attachment_single", "auto", "ai", "json", "internal", "barcodeqr", "signature_single", "bigint", "bb_reference", "bb_reference_single" ], "description": "Defines the type of the column, most explain themselves, a link column is a relationship." }, "constraints": { "type": "object", "description": "A constraint can be applied to the column which will be validated against when a row is saved.", "properties": { "type": { "type": "string" }, "presence": { "oneOf": [ { "type": "boolean", "description": "Defines whether the column is required or not." }, { "type": "object", "description": "Defines whether the column is required or not.", "properties": { "allowEmpty": { "type": "boolean", "description": "Defines whether the value is allowed to be empty or not." } } } ] }, "inclusion": { "type": "array", "description": "Defines the valid values for this column." } } }, "name": { "type": "string", "description": "The name of the column." }, "autocolumn": { "type": "boolean", "description": "Defines whether the column is automatically generated." }, "width": { "type": "number", "description": "Defines the width of the column in the data UI." } } } ] } } } }, "tableOutput": { "type": "object", "properties": { "data": { "description": "The table to be created/updated.", "type": "object", "required": [ "name", "schema", "_id" ], "properties": { "name": { "description": "The name of the table.", "type": "string" }, "primaryDisplay": { "type": "string", "description": "The name of the column which should be used in relationship tags when relating to this table." }, "schema": { "type": "object", "additionalProperties": { "oneOf": [ { "type": "object", "properties": { "type": { "type": "string", "enum": [ "link" ], "description": "A relationship column." }, "constraints": { "type": "object", "description": "A constraint can be applied to the column which will be validated against when a row is saved.", "properties": { "type": { "type": "string" }, "presence": { "oneOf": [ { "type": "boolean", "description": "Defines whether the column is required or not." }, { "type": "object", "description": "Defines whether the column is required or not.", "properties": { "allowEmpty": { "type": "boolean", "description": "Defines whether the value is allowed to be empty or not." } } } ] }, "inclusion": { "type": "array", "description": "Defines the valid values for this column." } } }, "name": { "type": "string", "description": "The name of the column." }, "autocolumn": { "type": "boolean", "description": "Defines whether the column is automatically generated." }, "width": { "type": "number", "description": "Defines the width of the column in the data UI." }, "fieldName": { "type": "string", "description": "The name of the column which a relationship column is related to in another table." }, "tableId": { "type": "string", "description": "The ID of the table which a relationship column is related to." }, "relationshipType": { "type": "string", "enum": [ "one-to-many", "many-to-one", "many-to-many" ], "description": "Defines the type of relationship that this column will be used for." }, "through": { "type": "string", "description": "When using a SQL table that contains many to many relationships this defines the table the relationships are linked through." }, "foreignKey": { "type": "string", "description": "When using a SQL table that contains a one to many relationship this defines the foreign key." }, "throughFrom": { "type": "string", "description": "When using a SQL table that utilises a through table, this defines the primary key in the through table for this table." }, "throughTo": { "type": "string", "description": "When using a SQL table that utilises a through table, this defines the primary key in the through tab