📝Updated documentation for the backend services
This commit is contained in:
committed by
Anton Shepilov
parent
904b767382
commit
3cf164787f
+37
-85
@@ -4,34 +4,39 @@ description: Application models for backend
|
||||
|
||||
# Database models
|
||||
|
||||
**applications**\
|
||||
\*\*\*\*Represent an application in the database
|
||||
**applications**
|
||||
|
||||
```javascript
|
||||
{
|
||||
//PK
|
||||
"company_id": uuid;
|
||||
"id": uuid;
|
||||
Represent an application in the database
|
||||
|
||||
"identity": ApplicationIdentity;
|
||||
"api": ApplicationApi;
|
||||
"access": ApplicationAccess;
|
||||
"display": ApplicationDisplay;
|
||||
"publication": ApplicationPublication;
|
||||
"stats": ApplicationStatistics;
|
||||
```Typescript
|
||||
export default interface Application {
|
||||
id: string;
|
||||
internal_domain?: string;
|
||||
external_prefix?: string;
|
||||
company_id: string;
|
||||
is_default: boolean;
|
||||
identity: ApplicationIdentity;
|
||||
api: ApplicationApi;
|
||||
access: ApplicationAccess;
|
||||
display: ApplicationDisplay;
|
||||
publication: ApplicationPublication;
|
||||
stats: ApplicationStatistics;
|
||||
}
|
||||
|
||||
type ApplicationIdentity = {
|
||||
export type ApplicationIdentity = {
|
||||
code: string;
|
||||
name: string;
|
||||
iconUrl: string;
|
||||
icon: string;
|
||||
description: string;
|
||||
website: string;
|
||||
categories: string[];
|
||||
compatibility: "tdrive"[];
|
||||
compatibility: "twake"[];
|
||||
repository?: string;
|
||||
};
|
||||
|
||||
type ApplicationPublication = {
|
||||
export type ApplicationPublication = {
|
||||
published: boolean;
|
||||
requested: boolean;
|
||||
};
|
||||
|
||||
type ApplicationStatistics = {
|
||||
@@ -56,73 +61,20 @@ type ApplicationDisplay = {
|
||||
tdrive: {
|
||||
"version": 1,
|
||||
|
||||
"files" : {
|
||||
"preview": {
|
||||
"url": "", //Url to preview file (full screen or inline)
|
||||
"inline": true,
|
||||
"main_ext": ["docx", "xlsx"], //Main extensions app can read
|
||||
"other_ext": ["txt", "html"] //Secondary extensions app can read
|
||||
},
|
||||
"actions": [ //List of action that can apply on a file
|
||||
{
|
||||
"name": "string",
|
||||
"id": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
//Chat plugin
|
||||
"chat": {
|
||||
"input": {
|
||||
"icon": "", //If defined replace original icon url of your app
|
||||
"type": "file" | "call" //To add in existing apps folder / default icon
|
||||
},
|
||||
"commands": [
|
||||
{
|
||||
"command": "mycommand", // my_app mycommand
|
||||
"description": "fdsqfds"
|
||||
}
|
||||
],
|
||||
"actions": [ //List of action that can apply on a message
|
||||
{
|
||||
"name": "string",
|
||||
"id": "string"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
//Allow app to appear as a bot user in direct chat
|
||||
"direct": {
|
||||
"name": "My app Bot",
|
||||
"icon": "", //If defined replace original icon url of your app
|
||||
},
|
||||
|
||||
//Display app as a standalone application in a tab
|
||||
"tab": {
|
||||
"url": ""
|
||||
},
|
||||
|
||||
//Display app as a standalone application on the left bar
|
||||
"standalone": {
|
||||
"url": ""
|
||||
},
|
||||
|
||||
//Define where the app can be configured from
|
||||
"configuration": ["global", "channel"]
|
||||
};
|
||||
"files": {
|
||||
"preview": {
|
||||
"url": "", //Url to preview file (full screen or inline)
|
||||
"inline": true,
|
||||
"main_ext": ["docx", "xlsx"], //Main extensions app can read
|
||||
"other_ext": ["txt", "html"] //Secondary extensions app can read
|
||||
},
|
||||
"actions": [ //List of action that can apply on a file
|
||||
{
|
||||
"name": "string",
|
||||
"id": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
**company_application**\
|
||||
\*\*\*\*Represent an application in a company
|
||||
|
||||
```javascript
|
||||
{
|
||||
"company_id": uuid;
|
||||
"application_id": uuid;
|
||||
"id": uuid;
|
||||
|
||||
"created_at": number;
|
||||
"created_by": string; //Will be the default delegated user when doing actions on TDrive
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user