App schema
Each app should follow strict schema with the following structure:
Name | Type | Description | Required | Example |
---|---|---|---|---|
name | string | Name of the app | true | "MyApp" |
type | "crunch" | Set to "crunch" if app has predefined schema | false | "crunch" |
website | string | Website of app | false | "http://myawesomeapp.com" |
version | string | App version | true | "1.0.0" |
description | string | App description | true | "My awesome app" |
authentication | Array<Authentication> | Available authentications in app | true | [{id: "none", name: "no auth"}] |
sources | Array<Source> | Available sources of data in app. Can't be empty. | true | [{id: "flowers", name: "Flowers"}] |
responsibleFor | Object | App responsibilities | true | {dataProviding: true} |
Authentication
Authentication model represents type of authentication in app and has following structure:
Name | Type | Description | Required | Example |
---|---|---|---|---|
id | "none"|"oauth"|"oauth2"|string | Authentication id | true | "none" |
name | string | Name of authentication | true | "Connection Settings" |
description | string | Description of authentication | false | "Give the name for connection" |
fields | Array<AuthenticationField> | Authentication fields | false | [{optional: false, id: "accountName", name: "Title", type: "text", description: 'Give the name for connection'}] |
If your app doesn't require authentication you should add authentication with id = "none". In the case you can omit fields.
Authentication field
Authentication field represents the field in account. So account that will send to API endpoints will consist of the authentication fields. Authentication field has following structure:
Name | Type | Description | Required | Example |
---|---|---|---|---|
id | string | Id of field. The id will be specified in account object. | true | "accountName" |
name | string | Name of the field. Will be displayed in auth form. | true | "Title" |
type | string (more about types) | Type of the field | true | "text" |
description | string | Description of the field | true | "Give the name for connection" |
optional | boolean | Is the field optional | false | false |
value | string | Default value of the field | false | null |
Note that authentication field with some types requires more information to specify. For example, for highlightText type you also need to specify editorMode in authentication field.
Source
Source represents kind of data and has following structure:
Name | Type | Description | Required | Example |
---|---|---|---|---|
id | string | Id of data source | true | "query" |
name | string | Name of data source | true | "Query" |
description | string | Description of data source | false | "PostgreSQL query" |
filter | Array<SourceFilter> | Array of filters for the data source | false | [{id: "query", title: "Query", type: "highlightText", editorMode: "sql"}] |
If source doesn't require any filtering you can omit filter field.
Source filter
Source filter represents filter that will be applied on source data. Source filter has following structure:
Name | Type | Description | Required | Example |
---|---|---|---|---|
id | string | Id of filter | true | "table" |
title | string | Title of filter | true | "Table" |
type | string (more about types) | Type of filter | true | "list" |
datalist | boolean | Is filter has values to select from | false | true |
optional | boolean | Is filter optional | false | false |
secured | boolean | Secured filter values are not available for change by non-chart owner | false | true |
Some additional properties should be specified in case when filters should be displayed in special modes, for example JSON or SQL. For example, for highlightText type you also need to specify editorMode for the filter field.