Twake
⬅️ Go on twake
  • ☀️ Twake
  • Getting started
    • ▶️Use Twake on twake.app
    • 🏗️Install on your server
      • 🎡Scale with Twake
    • ⚙️Configuration
      • 🔒Security
      • 🔗Custom domain + HTTPS
        • Apache2 configuration
      • 💌Configure mail server
      • 🎨Customisation
      • 🔌Connectors and plugins
      • 👨‍💻 Authentication modes
        • Using Keycloak (LDAP, OpenID and more)
        • Installing Twake with LemonLDAP (LDAP, OpenID and more)
  • How to use it
    • 👋Welcome to Twake !
    • 🧰Console
      • Users
    • 🏢Company & workspace
      • Invite user from Chat
      • Rights
    • 💠Applications
      • 💬Chat
        • Channels
        • Message
      • 📂Drive
        • File and folder
        • Share file with public link
      • 📆Calendar
      • ✅Tasks
      • 🔃Connectors
        • n8n
    • 🖥️Desktop and mobile app
    • 🔒Privacy
  • Developers API
    • 🏠Home
    • 🥇Getting started
      • Create your first application
      • Authenticate with Postman
      • Send a message with your application
      • Trigger action from command
    • ⚙️Application settings
      • Api
      • Display
      • Privileges
      • Identity
    • 📖API Reference
      • Webhook
      • Drive
      • Message
        • DELETE Request
        • POST Request
      • Authentication
    • 🧱Blocks
  • Internal Documentation
    • 🥇Get started
    • 🎨Twake Ecosystem Guidelines
    • 📚Our stack
    • 🧱Backend and APIs
      • 🔑(WIP) Authentication
      • 👥Users and workspaces
      • 🍎Applications
        • Database models
        • REST APIs
      • 🎩Channels and tabs
        • Database models
      • 💬Messages
        • Database models
      • 📄Files
        • Database models
        • REST APIs
        • Resumable.js
      • 📲Notifications
        • Database models
      • 🛠️Twake service development
        • What is a service in Twake ?
        • Create a new service
        • Platform/Technical services
          • Database ORM platform service
    • 🖥️Web, desktop and mobile
      • Table
      • ObjectModal
        • ObjectModalTitle
        • ObjectModalSeparator
        • ObjectModalSectionTitle
        • ObjectModalFormTitle
      • UserListManager
      • MediumPopupManager
      • MenuManager
    • 🎭Translation
Powered by GitBook
On this page

Was this helpful?

  1. Internal Documentation
  2. Backend and APIs
  3. Applications

Database models

Application models for backend

applications Represent an application in the database

{
  //PK
  "company_id": uuid;
  "id": uuid;

  "identity": ApplicationIdentity;
  "api": ApplicationApi;
  "access": ApplicationAccess;
  "display": ApplicationDisplay;
  "publication": ApplicationPublication;
  "stats": ApplicationStatistics;
}

type ApplicationIdentity = {
  name: string;
  iconUrl: string;
  description: string;
  website: string;
  categories: string[];
  compatibility: "twake"[];
};

type ApplicationPublication = {
  published: boolean;
};

type ApplicationStatistics = {
  createdAt: number;
  updatedAt: number;
  version: number;
};

type ApplicationApi = {
  hooksUrl: string;
  allowedIps: string;
  privateKey: string;
};

type ApplicationAccess = {
  privileges: string[];
  capabilities: string[];
  hooks: string[];
};

type ApplicationDisplay = {
  twake: {
    "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"]
  };
};

company_application Represent an application in a company

{
	"company_id": uuid;
	"application_id": uuid;
	"id": uuid;
	
	"created_at": number;
	"created_by": string; //Will be the default delegated user when doing actions on Twake
}
PreviousApplicationsNextREST APIs

Last updated 3 years ago

Was this helpful?

🧱
🍎