feat: init

This commit is contained in:
montaghanmy
2023-03-23 11:03:16 +01:00
commit 10fe6f78d1
11518 changed files with 509786 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
node_modules
dist
+176
View File
@@ -0,0 +1,176 @@
export default {
base: "/Twake/",
title: "Documentation",
description: "Public API documentation",
themeConfig: {
logo: "https://twake.app/images/logo-twake.svg",
sidebar: [
{
text: "Getting started",
items: [
{
text: "☀️ Welcome to Twake",
link: "index",
},
{
text: "⬇️ Desktop and mobile apps",
link: "download",
},
],
},
{
text: "On-premise",
items: [
{
text: "🏗 Run On-Premise",
link: "/onprem/installation",
},
{
text: "⚙️ Server configuration",
link: "/onprem/configuration/README.md",
},
],
},
{
text: "How to use Twake",
items: [
{
text: "👋 Welcome to Twake !",
link: "/how-to-use-it/welcome",
},
{
text: "🖥 Desktop and mobile app",
link: "/how-to-use-it/desktop-and-mobile-app",
},
{
text: "🔒 Privacy and security",
link: "/how-to-use-it/privacy-security",
},
{
text: "Console",
link: "/how-to-use-it/console/README.md",
items: [
{
text: "Users",
link: "/how-to-use-it/console/users",
},
],
},
{
text: "Company & workspace",
link: "/how-to-use-it/company-and-workspace/README.md",
items: [
{
text: "Invite user",
link: "/how-to-use-it/company-and-workspace/invite-user-from-chat",
},
{
text: "Rights",
link: "/how-to-use-it/company-and-workspace/rights",
},
],
},
{
text: "Chat",
link: "/how-to-use-it/applications/how-to-use-chat/README.md",
items: [
{
text: "Channels",
link: "/how-to-use-it/applications/how-to-use-chat/channels",
},
{
text: "Message",
link: "/how-to-use-it/applications/how-to-use-chat/message",
},
],
},
{
text: "Drive",
link: "/how-to-use-it/applications/drive/README.md",
items: [
{
text: "File and folder",
link: "/how-to-use-it/applications/drive/file-and-folder",
},
{
text: "Share file with public link",
link: "/how-to-use-it/applications/drive/share-file-with-public-link",
},
],
},
{
text: "Connectors",
link: "/how-to-use-it/applications/connectors/README.md",
items: [
{
text: "n8n",
link: "/how-to-use-it/applications/connectors/n8n",
},
],
},
],
},
{
text: "Internal documentation",
items: [
{
text: "Our stack",
link: "/internal-documentation/our-stack",
},
{
text: "Translation",
link: "/internal-documentation/translation",
},
{
text: "Backend services",
items: [
{
text: "Get started",
link: "/internal-documentation/backend-services/intro/README.md",
},
{
text: "Applications",
link: "/internal-documentation/backend-services/applications/README.md",
},
{
text: "Channels",
link: "/internal-documentation/backend-services/channels/README.md",
},
{
text: "Documents",
link: "/internal-documentation/backend-services/documents/README.md",
},
{
text: "Files",
link: "/internal-documentation/backend-services/files/README.md",
},
{
text: "Tags",
link: "/internal-documentation/backend-services/tags/README.md",
},
{
text: "Knowledge graph",
link: "/internal-documentation/backend-services/knowledge-graph/README.md",
},
{
text: "Notifications",
link: "/internal-documentation/backend-services/notifications/README.md",
},
],
},
{
text: "Frontend components",
items: [
{
text: "Get started",
link: "/internal-documentation/frontend-components/intro/README.md",
},
],
},
],
},
],
},
head: [],
};
@@ -0,0 +1,93 @@
#docsearch {
margin-right: 16px;
}
#docsearch .DocSearch-Button {
justify-content: flex-start;
border: 1px solid transparent;
border-radius: 8px;
padding: 0 10px 0 12px;
width: 100%;
height: 40px;
background-color: var(--vp-c-bg-alt);
}
#docsearch .DocSearch-Button:hover {
border-color: var(--vp-c-brand);
background: var(--vp-c-bg-alt);
}
#docsearch .DocSearch-Button-Placeholder {
transition: color 0.2s;
}
#docsearch .DocSearch-Button-Keys {
display: flex;
align-items: center;
min-width: auto;
pointer-events: auto;
}
#docsearch .DocSearch-Button .DocSearch-Button-Key+.DocSearch-Button-Key {
border-right: 1px solid var(--vp-c-divider);
border-left: none;
border-radius: 0 4px 4px 0;
padding-left: 2px;
padding-right: 6px;
}
#docsearch .DocSearch-Button .DocSearch-Button-Key {
display: block;
margin: 2px 0 0;
border: 1px solid var(--vp-c-divider);
border-right: none;
border-radius: 4px 0 0 4px;
padding-left: 6px;
min-width: 0;
width: auto;
height: 22px;
line-height: 22px;
font-family: var(--vp-font-family-base);
font-size: 12px;
font-weight: 500;
transition: color .5s,border-color .5s;
}
/* Modal */
.DocSearch-Modal, .modal {
border-radius: 6px;
flex-direction: column;
margin: 60px auto auto;
max-width: 600px;
position: relative;
}
.modal .flex-logo {
width: 56px;
margin-left: calc(100% - 74px);
}
.DocSearch-Input {
margin-left: 0px;
margin-right: 14px;
font-size: 16px;
padding: 12px;
}
.modal .search-item {
border-radius: 4px;
display: flex;
padding-bottom: 4px;
position: relative;
align-items: center;
display: flex;
flex-direction: row;
height: 56px;
padding: 0 16px 0 16px;
}
.modal .search-item-icon {
display: none;
}
@@ -0,0 +1,4 @@
import DefaultTheme from "vitepress/theme";
import "./custom.css";
export default DefaultTheme;
+86
View File
@@ -0,0 +1,86 @@
# Table of contents
- [☀️ Twake](index.md)
## Getting started <a href="#gettingstarted" id="gettingstarted"></a>
- [▶ Use Twake on twake.app](gettingstarted/use-twake-on-twake.app.md)
- [🏗 Install on your server](onprem/installation.md)
- [⚙ Configuration](onprem/configuration/index.md)
- [🔒 Security](onprem/configuration/security.md)
- [🔗 Custom domain + HTTPS](onprem/configuration/custom-domain-and-https/README.md)
- [Apache2 configuration](onprem/configuration/custom-domain-and-https/apache2-configuration.md)
- [💌 Configure mail server](onprem/configuration/configure-mail-server.md)
- [🎨 Customisation](onprem/configuration/customisation.md)
- [🔌 Connectors and plugins](onprem/configuration/connectors-and-plugins.md)
- [👨‍💻 Authentication modes](onprem/configuration/authentication-modes/README.md)
- [Using Keycloak (LDAP, OpenID and more)](onprem/configuration/authentication-modes/using-keycloak-ldap-openid-and-more.md)
- [Installing Twake with LemonLDAP (LDAP, OpenID and more)](onprem/configuration/authentication-modes/installing-twake-with-lemonldap-ldap-openid-and-more.md)
## How to use it
- [👋 Welcome to Twake !](how-to-use-it/welcome.md)
- [🧰 Console](how-to-use-it/console/README.md)
- [Users](how-to-use-it/console/users.md)
- [🏢 Company & workspace](how-to-use-it/company-and-workspace/README.md)
- [Invite user from Chat](how-to-use-it/company-and-workspace/invite-user-from-chat.md)
- [Rights](how-to-use-it/company-and-workspace/rights.md)
- [💠 Applications](how-to-use-it/applications/README.md)
- [💬 Chat](how-to-use-it/applications/how-to-use-chat/README.md)
- [Channels](how-to-use-it/applications/how-to-use-chat/channels.md)
- [Message](how-to-use-it/applications/how-to-use-chat/message.md)
- [📂 Drive](how-to-use-it/applications/drive/README.md)
- [File and folder](how-to-use-it/applications/drive/file-and-folder.md)
- [Share file with public link](how-to-use-it/applications/drive/share-file-with-public-link.md)
- [📆 Calendar](how-to-use-it/applications/calendar.md)
- [✅ Tasks](how-to-use-it/applications/tasks.md)
- [🔃 Connectors](how-to-use-it/applications/connectors/README.md)
- [n8n](how-to-use-it/applications/connectors/n8n.md)
- [🖥 Desktop and mobile app](how-to-use-it/desktop-and-mobile-app.md)
- [🔒 Privacy and security](how-to-use-it/privacy-security.md)
## Developers API
- [🏠 Home](developers-api/home.md)
- [🥇 Getting started](developers-api/get-started/README.md)
- [Create your first application](developers-api/get-started/create-your-first-application.md)
- [Authenticate with Postman](developers-api/get-started/authenticate-postman.md)
- [Send a message with your application](developers-api/get-started/send-a-message-for-twake.md)
- [Trigger action from command](developers-api/get-started/trigger-action-from-command.md)
- [⚙ Application settings](developers-api/application-settings/README.md)
- [Api](developers-api/application-settings/api.md)
- [Display](developers-api/application-settings/application-visibility-example.md)
- [Privileges](developers-api/application-settings/privileges.md)
- [Identity](developers-api/application-settings/identity.md)
- [📖 API Reference](developers-api/api-reference/README.md)
- [Webhook](developers-api/api-reference/wehbook.md)
- [Drive](developers-api/api-reference/drive.md)
- [Message](developers-api/api-reference/message/README.md)
- [Authentication](developers-api/api-reference/auth.md)
- [🧱 Blocks](developers-api/blocks.md)
## Internal Documentation
- [🥇 Get started](developers-api/run-twake-as-developer.md)
- [🎨 Twake Ecosystem Guidelines](internal-documentation/twake-ecosystem-guidelines.md)
- [📚 Our stack](internal-documentation/our-stack.md)
- [🧱 Backend and APIs](internal-documentation/backend-services/README.md)
- [👥 Users, workspaces and companies](internal-documentation/backend-services/users/README.md)
- [🍎 Applications](internal-documentation/backend-services/applications/README.md)
- [Database models](internal-documentation/backend-services/applications/database-models.md)
- [REST APIs](internal-documentation/backend-services/applications/rest-apis.md)
- [🎩 Channels and tabs](internal-documentation/backend-services/channels/README.md)
- [Database models](internal-documentation/backend-services/channels/database-models.md)
- [💬 Messages](internal-documentation/backend-services/messages/README.md)
- [Database models](internal-documentation/backend-services/messages/database-model.md)
- [📄 Files](internal-documentation/backend-services/files/README.md)
- [Database models](internal-documentation/backend-services/files/database-models.md)
- [Resumable.js](internal-documentation/backend-services/files/resumablejs.md)
- [📲 Notifications](internal-documentation/backend-services/notifications/README.md)
- [Database models](internal-documentation/backend-services/notifications/database-models.md)
- [🛠 Twake service development](internal-documentation/backend-services/intro/README.md)
- [What is a service in Twake ?](internal-documentation/backend-services/intro/start-working-into-a-service.md)
- [Create a new service](internal-documentation/backend-services/intro/create-a-new-twake-service.md)
- [Platform/Technical services](internal-documentation/backend-services/intro/platform/README.md)
- [Database ORM platform service](internal-documentation/backend-services/intro/platform/database-orm-platform-service.md)
- [🎭 Translation](internal-documentation/translation.md)
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 500 500" style="enable-background:new 0 0 500 500;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;}
</style>
<g>
<path class="st0" d="M162.7,196.1v-73c0-4.1,2.2-7.8,5.7-9.8l75.1-43.1c3.5-2,7.7-2,11.2,0l76.2,43.1c3.6,2,5.8,5.8,5.8,9.9v73.1
c0,8.7-9.4,14.2-16.9,9.9l-65-36.8c-3.5-2-7.8-2-11.2,0l-63.8,36.6C172.1,210.3,162.7,204.8,162.7,196.1z"/>
<path class="st0" d="M232.4,374.2l-66.1,36.3c-3.5,1.9-7.8,1.9-11.2-0.2l-72.6-42.8c-3.5-2-5.6-5.8-5.6-9.8v-86.1
c0-4.1,2.2-7.8,5.7-9.8l63.2-36.5c7.6-4.4,17,1.1,17,9.8l0,73.4c0,4.1,2.2,7.9,5.8,9.9l63.9,35.8
C240.2,358.7,240.2,369.9,232.4,374.2z"/>
<path class="st0" d="M353.7,225.5l63.2,36.5c3.5,2,5.7,5.8,5.7,9.8l0,86c0,4.1-2.2,7.8-5.7,9.8l-75.1,43c-3.5,2-7.8,2-11.3,0
l-63.1-36.4c-7.6-4.4-7.6-15.3,0-19.7l63.6-36.5c3.5-2,5.7-5.8,5.7-9.8l0-72.9C336.7,226.6,346.2,221.1,353.7,225.5z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

@@ -0,0 +1,6 @@
---
description: Discover our wonderful API
---
# 📖 API Reference
@@ -0,0 +1,24 @@
---
description: How to manage authentification on API call
---
# Authentication
## Authencate your app in Twake
**All your connections** should respect the Basic access authentication protocol, which must be used via HTTPS, except in development mode. In order to make an API call with this method, you must add an HTTP header:
```text
Authorization: Basic base64(public_id:private_api_key)
```
**You must concatenate** your [public_id and private_api_key](../get-started/README.md#identity-and-api-settings) , **then convert** the whole **to base64**. Your HTTP header will therefore look like:
```text
# For the keys 'public_id' and 'private_key'
Authorization: Basic cHVibGljX2lkOnByaXZhdGVfYXBpX2tleQ==
```
## Authencate your app in a company
**All your requests should have at least a "group_id" key with the company id you**
@@ -0,0 +1,6 @@
---
description: How to manage Drive through API
---
# Drive
@@ -0,0 +1,21 @@
---
description: How to manage messages through API
---
# Message
_While users have the ability to create message complexes using the built-in formatting system, applications can go even further and offer many types of messages such as system messages for notifications or interactive messages for your most popular applications._
## Group_id and channel_id:
1. Get the current front id:
`channel_service.currentChannelFrontId`
2. With the channel front id, you will be able to get the channel id by doing this:
`collections.collections.channels.manager.findByFrontId("My-Front-Id")`
3. Get the current group id:
`workspaceService.currentGroupId`
@@ -0,0 +1,6 @@
---
description: How to use webhook with Twake
---
# Webhook
@@ -0,0 +1,6 @@
---
description: Set your application
---
# ⚙ Application settings
@@ -0,0 +1,6 @@
---
description: There you will find some important pieces of information
---
# Api
@@ -0,0 +1,152 @@
---
description: This is a JSON parameter to define where your app should appear
---
# Display
#### Latest version
```typescript
{
twake: {
version: 1;
files?: {
preview?: {
url: string; //Url to preview file (full screen or inline)
inline?: boolean;
main_ext?: string[]; //Main extensions app can read
other_ext?: string[]; //Secondary extensions app can read
};
actions?: //List of action that can apply on a file
{
name: string;
id: string;
}[];
};
//Chat plugin
chat: {
input?:
| true
| {
icon?: string; //If defined replace original icon url of your app
type?: "file" | "call"; //To add in existing apps folder / default icon
};
commands?: {
command: string; // my_app mycommand
description: string;
}[];
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?:
| true
| {
name?: string;
icon?: string; //If defined replace original icon url of your app
};
//Display app as a standalone application in a tab
tab?: {
url: string;
};
//Display app as a standalone application on the left bar
standalone?: {
url: string;
};
//Define where the app can be configured from
configuration: ("global" | "channel")[];
};
};
```
#### Legacy format
```javascript
type ApplicationDisplay = {
twake:
{
"version": 0, //Legacy
"tasks_module" : {
"can_connect_to_tasks": true
},
"calendar_module" : {
"can_connect_to_calendar": true
}
"drive_module" : {
"can_connect_to_directory": true,
"can_open_files": {
"url": "", //Une url à appeler pour éditer le fichier (ouvert dans un onglet)
"preview_url": "", //Une url à appeler pour prévisualiser un fichier (iframe)
"main_ext": ["docx", "xlsx"], //Extensions principales
"other_ext": ["txt", "html"] //Extensions secondaires
},
"can_create_files": [
{
"url": "https://[...]/empty.docx",
"filename": "Untitled.docx",
"name": "Word Document"
},
{
"url": "https://[...]/empty.xlsx",
"filename": "Untitled.xlsx",
"name": "Excel Document"
}
]
},
"member_app": true, // Si défini, votre application génèrera un membre
// virtuel dans l'espace de travail avec lequel les
// utilisateurs pourront discuter.
"messages_module": {
"in_plus": {
"should_wait_for_popup": true
},
"right_icon": {
"icon_url": "", //If defined replace original icon url of your app
"should_wait_for_popup": true,
"type": "file" //"file" | "call"
},
"action": {
"should_wait_for_popup": true,
"description": "fdsqfds" //Description de l'action, sinon remplacé par le nom de l'app
},
"commands": [
{
"command": "mycommand", // my_app mycommand
"description": "fdsqfds"
}
]
},
"channel": {
"can_connect_to_channel": ""
},
"channel_tab": {
"iframe": ""
},
"app": {
"iframe": "",
"plus_btn": {
"should_wait_for_popup": true
}
},
"configuration": {
"can_configure_in_workspace": true,
"can_configure_in_channel": true,
"can_configure_in_calendar": true,
"can_configure_in_tasks": true,
//"can_configure_in_directory": true
}
}
}
}
```
@@ -0,0 +1,6 @@
---
description: How Identity are managed
---
# Identity
@@ -0,0 +1,6 @@
---
description: Which privileges you need for your app
---
# Privileges
+160
View File
@@ -0,0 +1,160 @@
# 🧱 Blocks
## Introduction: <a href="#introduction" id="introduction"></a>
This guide will introduce you to use blocks to custom Twake messages. Twake allows application to send customs messages. This customs messages offer the possibility for an application to easily format the text your application wants to send and/or display UI components like button, input or iframe.&#x20;
## Write your first block: <a href="#introduction" id="introduction"></a>
### 1. Take a look at slack block kit documentation&#x20;
* Go to this page: [Slack Block kit](https://api.slack.com/block-kit)
* Understand basic layers of block:
* Block
First layer object, defining the use case of the current block (Actions, Context, Header, Files...). It can contain block elements and Composition object.&#x20;
* Block elements
Second layer object, defining complex element that will be display in a block (Button, Menus, Input...). It can contain composition object
* Composition object&#x20;
Third layer object, formatting the data to display in both block and/or block elements
### 2. Try your first block&#x20;
* Go to this page: [Block Kit Builder](https://app.slack.com/block-kit-builder)
* Try to add/remove block&#x20;
* Start writing block and check your result
### 3. Twake block&#x20;
Twake have some blocks that are not implemented in slack block kit (iframes, progress bar and copiable). To use them please follow this:&#x20;
#### iframe &#x20;
An iframe is **Block** allowing you to display an html page in twake.
How to use it:&#x20;
* Iframe type:&#x20;
```
type BlockIframe = {
type: "iframe";
iframe_url: string;
width: number;
height: number;
};
```
* type: always "iframe"
* iframe\_url: the URL of the web page you want to display&#x20;
* width: the with that you iframe will take
* height: the height that you iframe will take
Example:&#x20;
```
{
"blocks": [
{
"type": "iframe",
"iframe_url": "
https://twake.app
",
width: "40vh",
height: "40vh"
}
]
}
```
#### Copiable
A copiable is **Block element** is a readable only input allowing you to copy string with a button.
How to use it:&#x20;
* Copiable type: it is a plain text input block element with readonly and copiable set to true
```
type BlockElementPlaintextInput = {
type: "plain_text_input";
action_id: string;
placeholder?: CompositionPlainTextObject;
initial_value?: string;
multiline?: boolean;
min_length?: number;
max_length?: number;
dispatch_action_config?: DispatchActionConfiguration;
readonly?: boolean;
copiable?: boolean;
};
```
* type: always `"plain_text_input"`
* readonly: always `true`
* copiable: always `true`
Example :&#x20;
```
{
"blocks": [
{
"type": "input",
"element": {
"type": "plain_text_input",
"action_id": "plain_text_input-action",
"initial_value": "https://twake.app"
"readonly": true,
"copiable": true,
},
}
]
}
```
#### Progress bar
A Progess bar is **Block element** that display a progress bar.
How to use it:&#x20;
* Progress bar type:
```
export type BlockElementProgressBar = {
type: "progress_bar";
value: number;
title: string;
};
```
* type: always `"progress_bar"`
* value: the value of your progress between 0 and 100
* title: the title associate to your progress bar
Example :&#x20;
```
{
"blocks": [
{
"type": "progress_bar",
"value": 50,
"title": "Chargement"
}
]
}
```
&#x20;
@@ -0,0 +1,19 @@
---
description: 'Welcome to the developers API of Twake, let''s begin together'
---
# 🥇 Getting started
## Introduction:
_While users have the ability to create message complexes using the built-in formatting system, applications can go even further and offer many types of messages such as system messages for notifications or interactive messages for your most popular applications._
## Basics:
* [Create your first application](create-your-first-application.md)
* [Authenticate with Postman](authenticate-postman.md)
* [Send a message with your application](send-a-message-for-twake.md)
* [Trigger action from command](trigger-action-from-command.md)
@@ -0,0 +1,39 @@
---
description: Postman example
---
# Authenticate with Postman
## Introduction:
This guide will introduce you to authenticate with [Postman](https://www.getpostman.com).
## Prerequisites:
* _You are a **manager** of the company._
* You have already [created a Twake application](create-your-first-application.md).
* _You have previously installed_ [_Postman_](https://www.getpostman.com)_._
## Steps:
### 1. Log your Application
* Open Postman&#x20;
* Find the app's credentials according to [#3.-api-settings](create-your-first-application.md#3.-api-settings "mention")
* Send POST request with :&#x20;
* Url: https://web.twake.app/api/console/v1/login
* Headers: `{ "Content-Type": "application/json", }`
* Body: `{ id: $APP_`_`ID, secret: $APP_SECRET`_` ``}`
* This POST request will return a JWT token, this token will allow your application to send events in Twake
### 2. Optional: Verify your token
If you're not sure that the procedure to generate a token goes well :&#x20;
* Send GET request with :&#x20;
* Url: https://web.twake.app/api/console/v1/me
* Headers: `{ "Content-Type": "application/json",` Authorization: "`Bearer " + $APP_TOKEN }`
### &#x20;
@@ -0,0 +1,78 @@
---
description: >-
You want to create an application for Twake? It's easy, just follow the steps
in this documentation! 😀
---
# Create your first application
## Introduction:
This guide will walk you through creating, setting up and installing a Twake application.
## Prerequisites:
- _You are a **manager** of the company._
## Steps:
### 1. Create a Twake application
![ Fastest way to create an app](../../assets/twake-create-a-twake-app.gif)
1. _Start by opening your `Workspace settings`_
2. _Go to `Applications and connectors`, you should see an **Installed applications area** and **Applications developed by the company**,_
3. _Click on `Access your applications and connectors` then `Create an application`,_
4. _Enter your application name and application group._&#x20;
**Application group** is used to group your application with other applications of the same type. **Be careful, the application group will not be modifiable later.**
### **2. Identity of the application (Optional)**
![](../../assets/twake-identity-of-the-application.gif)
Let's add a description and an icon for our application. \
it will be much prettier! 😇
### 3. API settings
There you will find some important pieces of information:
![](../../assets/twake-api-settings.gif)
- _Your API private key,_
- _Your public application identifier,_
- _URL that will be used to receive events for your application,_
- _List of IP addresses that have the right to call the Twake API with your credentials. (You can use `*`during the development of your application.)_
**Private key** and **Public application identifier** relate to **calls to the Twake API**.
### 4. Display settings (Optional)
![You can fill your JSON object here](../../assets/twake-display-settings.png)
To configure where your application should display, you need to fill a `JSON` object in `Display Settings` field.
[Here](../application-settings/application-visibility-example.md) is a quick example, each field is optional and his presence determines the positioning of your application in Twake.
### 5. Application privileges
![](../../assets/twake-application-privileges.gif)
Your application can access and modify data, only according to your needs you don't need to access all the data present in Twake. \
\
This is why you must specify the accesses for the proper functioning of your application. These accesses will be public and indicated to the user before the installation of your application.
In our example, we will only add `message_save` and `message_remove` in `Write privileges`.\
\
If you want to know more about capabilities and privileges, take a look at the list [here](../application-settings/privileges.md).
### 6. Install application
Once you've configured your application, you need to install it on Twake.&#x20;
![](../../assets/twake-install-application.gif)
Go to `Applications and connectors`, search and display your application then install it.
Your application is now ready, check the [Authenticate with Postman](authenticate-postman.md) documentation for starting using it !
@@ -0,0 +1,66 @@
---
description: Send a message through API
---
# Send a message with your application
\
Introduction: <a href="#introduction" id="introduction"></a>
---
This guide will introduce you to send message with your application in Twake.
## Prerequisites: <a href="#prerequisites" id="prerequisites"></a>
- You have already created a Twake application.
- _Your application is installed and saved in your company._
## Steps: <a href="#steps" id="steps"></a>
### 1. Send message as a new Thread&#x20;
- Find the app's token according to [1. Log your Application](authenticate-postman.md#1.-log-your-application)
- Find the identifiers to target a channel:
- Company's _id: $COMPANY_ID_
- Workspace's \_id: $WOKSPACE\_\_ID
- Channel's _id: $CHANNEL_ID_
- _Set the message you want to send:_
- _Minimal:_&#x20;
_$MESSAGE = { "text": "Hello world !" }_
- _To take full advantage of the messages capability in Twake see the_ [_MessageObject_](../../internal-documentation/backend-services/messages/database-model.md)\_\_
- Send POST request with :&#x20;
- Url: https://web.twake.app/api/messages/v1/companies/$COMPANY\_ID/threads
- Headers: `{ "Content-Type": "application/json",` Authorization: "`Bearer " + $APP_TOKEN }`
- Body: `{ resource: { participants: [ { type: "channel", id: $CHANNEL_ID, company_id: $COMPANY_ID, workspace_id: $WORKSPACE_ID, }, ], }, options: { $MESSAGE }, }`
- This POST request will return a [ThreadObject](../../internal-documentation/backend-services/messages/database-model.md)
### 2. Send message as a Thread answer
- Find the app's token according to [1. Log your Application](authenticate-postman.md#1.-log-your-application)
- Find the identifiers to target a channel:
- Company's _id: $COMPANY_ID_
- Workspace's \_id: $WOKSPACE\_\_ID
- Channel's _id: $CHANNEL_ID_
- _Thread's id: $THREAD_Id_
- _Set the message you want to send:_
- _Minimal:_&#x20;
_$MESSAGE = { "text": "Hello world !" }_
- _To take full advantage of the messages capability in Twake see the_ [_MessageObject_](../../internal-documentation/backend-services/messages/database-model.md)\_\_
- Send POST request with :&#x20;
- Url: https://web.twake.app/api/messages/v1/companies/$COMPANY_ID/threads/$THREAD\__ID
- Headers: `{ "Content-Type": "application/json",` Authorization: "`Bearer " + $APP_TOKEN }`
- Body: `{ resource: { $MESSAGE } }`
- This POST request will return a [MessageObject](../../internal-documentation/backend-services/messages/database-model.md)
### 3. Applications can send customized messages&#x20;
The [MessageObject](../../internal-documentation/backend-services/messages/database-model.md) object have a property called "block" that allow your application to send messages which contains more than a simple string. For example in an application message you can display an iFrame, buttons, menu selector, etc... Combining all this options you can create everything you want up to the limit of your imagination. To understand how to create powerful message using the block property see [blocks](../blocks.md).
@@ -0,0 +1,41 @@
---
description: Trigger action from command
---
# Trigger action from command
## Introduction: <a href="#introduction" id="introduction"></a>
This guide will introduce you to trigger action from your application using command
## Prerequisites: <a href="#prerequisites" id="prerequisites"></a>
* You have already created a Twake application.
* Your application is installed and saved in your company.
## Steps: <a href="#steps" id="steps"></a>
### 1. Let your application listen to command
* Go in your app developer's setting:&#x20;
* Click on your username in the top left corner
* Go to workspace settings&#x20;
* Go to integrations&#x20;
* Click on the three-dot next to your application
* Open developper setting&#x20;
* Click on display&#x20;
* You will find and editable object containing a twake object
* Add a new property commands in this object like this:
* `"commands" : [{"command": string, "descritpion": string }]`
* The first property of commands is command that let you define a name for your command, by default the command name is the name of your application.&#x20;
* The second property of command is description that let you describe the way to use the command you want to define.
### 2. Use your command in a channel
* In the message editor write /command&#x20;
* A popup displaying the description on how to use the command related to your application should open.
__
+36
View File
@@ -0,0 +1,36 @@
---
description: >-
Welcome to the developers API home, here you can create apps, plugins and
connectors for Twake.
---
# 🏠 Home
## Introduction:
Twake offer the possibility to uses a lot of application to increase the quality of your team workflow. You can now easily send a Gif to add conviviality into your channels, start Jitsi calls in one click, create polls or even get notified in your channels using webhooks or automation as powerful as n8n allows.
## Ready to use integration:
Twake have some integrations ready to use that are just waiting for you to be installed in your workspaces. You can find in the list below these integrations:
* Jitsi: [https://github.com/linagora/Twake-Plugins-Jitsi](https://github.com/linagora/Twake-Plugins-Jitsi)
* Giphy: [https://github.com/linagora/Twake-Plugins-Giphy](https://github.com/linagora/Twake-Plugins-Giphy)
* SimplePoll: [https://github.com/linagora/Twake-Plugins-SimplePoll](https://github.com/linagora/Twake-Plugins-SimplePoll)
* Webhoocks: [https://github.com/linagora/Twake-Plugins-Webhooks](https://github.com/linagora/Twake-Plugins-Webhooks)
* N8n: [https://github.com/linagora/Twake-Plugins-n8n](https://github.com/linagora/Twake-Plugins-n8n)
## Imagination is your limit&#x20;
By installing webhooks or n8n in your workspace, you can now imagine infinite uses cases to increase the quality of your team workflow. Connect your channels to get notify of new code changes when pushing on github or to get notify in a n8n workflow.&#x20;
If you think that you can't do something with integration, as Twake is open source, feel free to contribute to an existing Twake's integration or even more create the new integration that answer to your need. &#x20;
> Please do not work on this list of plugins as we already made them (their are just not yet open-sourced)\
> Zapier, IFTTT, OnlyOffice, RSS feed, Github, Gitlab and Reminder.
🤗 We are not yet ready for this documentation, up this issue to have it sooner : [https://github.com/TwakeApp/Twake/issues/116](https://github.com/TwakeApp/Twake/issues/116)
@@ -0,0 +1,70 @@
---
description: >-
Welcome to the internal documentation section. This chapter is for developers
working in Twake team or wanting to participate in the project.
---
# 🥇 Get started
> If you are looking for the Developers API of Twake to make plugins, apps or connectors, go here : [Developers API](../developers-api/home.md)
## Before to start
- Fork our repo [https://github.com/TwakeApp/Twake](https://github.com/TwakeApp/Twake) and checkout the **develop** branch
::: info
You want to fix a translation issue? We use Weblate: [https://hosted.weblate.org/projects/linagora/twake-chat-web/](https://hosted.weblate.org/projects/linagora/twake-chat-web/)
:::
## Run the backend (+ database)
1. Go to "twake/"
2. `docker-compose -f docker-compose.dev.mongo.yml up -d`
3. The backend will be running on port 3000
## Run the frontend
1. Go to "twake/frontend"
2. Run `yarn install` (better to use **yarn** than **npm**), our developers uses node 14 and 16, it should work with any upper version.
3. Prepare the **environment.ts** file like this: `cp environment/environment.ts.dist.dev environment/environment.ts`
```
export default {
env_dev: true,
front_root_url: 'http://localhost:3001',
api_root_url: 'http://localhost:3000',
websocket_url: 'ws://localhost:3000'
};
```
5\. Run `yarn start`
6\. It will propose to run on another port, say "yes" to run it on port 3001.
## Test and start develop
You should be able to go on localhost port 3001 just click on "create an account" and you'll be able to access Twake after a few steps.
\-> Logs from backend can be accessed from `docker-compose -f docker-compose.dev.mongo.yml logs -f --tail 100`
\-> Logs from frontend are visible in the output of `yarn start`
You can start writing code 🎉 ! It will reload the backend / frontend automatically each time you save.
::: danger
Before to start implementing a new feature or bug fix, please find or create an issue on our repository (here [https://github.com/linagora/Twake/issues](https://github.com/linagora/Twake/issues)) and put a comment to inform that you will work yourself on the issue. To avoid two same people doing the same work ;)
:::
::: info
If you have any issue, please come and join us on [https://community.twake.app/](https://community.twake.app)
:::
## Propose an improvement to be merged
For this you need to create a merge request on Github from your fork to our develop branch. Goes there: [https://github.com/linagora/Twake/compare](https://github.com/linagora/Twake/compare) and click "compare across forks".
Tests will be ran automatically and should pass before to merge the code.
::: info
We are hiring! Apply now on [https://job.linagora.com/en/join-us/](https://job.linagora.com/en/join-us/)
:::
+15
View File
@@ -0,0 +1,15 @@
---
description: How to download Twake
---
# ⬇️ Download desktop and mobile apps
## Desktop
You can download Twake for Mac, Windows, Linux here: [https://twake.app/download](https://twake.app/download)
Click on the version according your OS, and click on "download" to get the desktop application.
## Mobile
iOS, Android is also available from Google Play Store and the App Store.
+1
View File
@@ -0,0 +1 @@
# Get started
@@ -0,0 +1,6 @@
---
description: Discover Twake application
---
# 💠 Applications
@@ -0,0 +1,6 @@
---
description: How to use Twake calendar
---
# 📆 Calendar
@@ -0,0 +1,6 @@
---
description: How to add connector on Twake
---
# 🔃 Connectors
@@ -0,0 +1,21 @@
---
description: Did you ever dreamed to use Twake and n8n together ?
---
# n8n
## How to connect Twake with n8n
n8n is a powerful workflow automation tool wich can be self hosted : [n8n.io](https://n8n.io)
![n8n interface](../../../assets/image.png)
### Install n8n in Twake
Install your n8n application in your workspace and get your key :
![](../../../assets/how-to-install-n8n.gif)
### Create your credential on n8n
![](../../../assets/n8n-implement.gif)
@@ -0,0 +1,6 @@
---
description: How you can use the drive on Twake
---
# 📂 Drive
@@ -0,0 +1,8 @@
---
description: How you can create file & folder on Twake
---
# File and folder
##
@@ -0,0 +1,21 @@
---
description: How you can share your files with a public link
---
# Share file with public link
In Twake, you can share your folders or files to external user. You juste have to create a public link on what you want to share and send the link. Your partner will access to these elements without creating a Twake account.
### Create a public link
Click on "public access" of what you want to share and "create an access link".
![](../../../assets/sans-titre-2-1.gif)
###
### Remove a public link
If you want to remove the public link, select folder you want to unlink, then, "Public access" and "Suppress the link"
![](../../../assets/sans-titre-2.gif)
@@ -0,0 +1,11 @@
---
description: How Twake chat is working
---
# 💬 Chat
The discussion application are Twake's entry points. This is where you communicate with your team.
[channels](channels.md)
[message](message.md)
@@ -0,0 +1,51 @@
---
description: Discover how channels are used on Twake
---
# Channels
## Create a channel
To create a channel, you must have `Administrator` rights for the workspace in question.
[rights](../../company-and-workspace/rights.md)
To create your channel, click on the `+` button right to the "Channel" inscription. Fill a name for your channel, select a wonderful emoji and select if it is a public or private channel \(by default, channels are private\).
## Channel sections
You can organize your channel by grouping them. If you are `Administrator`, you can drag a channel and drop in the section you want `Add here` or in `New group`.
To edit section name, you just have to click on it, change the name and press `Enter`
![](../../../assets/channel-move.gif)
## Public channel
Public channels are visible to all members of the workspace.
## Private channel
Private channels are channels accessible only to a limited number of users. Members not present in these channels cannot see them.
### Modify the members of a private channel
You can choose the members of a private channel when creating it. To modify the members of a private channel once created, place your mouse on the channel, click on the `...` then on `Edit channel`, in the `Participants` box, you can add or remove the members of the channel.
![](../../../assets/private-channel-member.gif)
## External member
You have the possibility to invite external members to your channel. External members are members who are not in the workspace and who are added to one, or more, specific channel\(s\).
This feature is useful for inviting users who are not in your company. Freelancers, for example, can be added to a specific channel to collaborate on a project. They will only have access to this channel, they will not see public channels.
![](../../../assets/externalmember.gif)
## Mute a channel
You can mute a channel so that you do not receive notification of it. You will not receive a new notification from that channel unless you are mentioned \(with @username\). To do it, click on `...` and `Mute`a barred bell icon will appear.
## Star a channel
If a channel is very important for you, you can star it. Stared channels are gathered at the top of your channel. It is only for your view, not for everyone. To star a channel click on `...` and `Star this channel`. Your channel will be move to the stared channel section \(at the top\).
@@ -0,0 +1,59 @@
---
description: Send message on Twake
---
# Message
## Send a message
To send a message, select the channel where you want to post. In the input message, write what you want to send. Press `enter` to send the message.
If you want to add a new line to your message, press `Shift + Enter`.
![](../../../assets/sendmessage.gif)
#### Pin
If one of the message is important for the team, you can pin it \(or unpin\)
![](../../../assets/pinmessage.gif)
#### Reaction
You can react to a message with emoji. Click on the `Emoji button` in message to show emoji picker.
### Response to a message
Someone ask you a question ? You can answer it by clicking `Answer` below the message.
![](../../../assets/responsemessage.gif)
### Reorganize your chat
You can reorganize your chat by dragging and dropping your messages.
![](../../../assets/d-and-dmessage.gif)
###
### See thread message
You can see a thread in a specific view. Hover over in one, the button `Show on the right` . A side panel opens.
## Integration
### Gif
You can send gif in your channel. Just clic gif icon to open a gif selector.
![](<../../../assets/gif-(1).gif>)
### Call
If you need to call your team, there is native integration with Jitsi. Just click on the green button with the phone and a menu opens on the left to create a Jitsi call. Once the information is filled in, the call link is sent to your team.
## Send document
If you want to send a document through the chat, drag it from your computer and drop it into the chat. It will be uploaded and shared with your teammates.
You can also send a document from Twake drive: click on the `+` button, to the left of the input. You can select a file from Twake and share it in the chat room.
@@ -0,0 +1,6 @@
---
description: How to use Twake task
---
# ✅ Tasks
@@ -0,0 +1,17 @@
---
description: How company and workspace work on Twake
---
# 🏢 Company & workspace
## Company
Companies are the largest entities on Twake. They represent your virtual business. You will find all your employees and connectors that you have developed internally. Inside your company is your workspaces.
You can switch from one company to an other by clicking on the left bottom button :
![](../../assets/changecomp.gif)
## Workspace
Workspaces represent the teams or departments in your company. Each workspace has its members, discussions, files, tasks, and calendar. It's your team's sharing space.
@@ -0,0 +1,15 @@
---
description: Invite user from Twake
---
# Invite user from Chat
You can invite user in your workspace.
Open the menu, and click on `Collaborators` &gt; `Add colleagues`. Enter emails of your colleagues \(separated with coma\) and validate.
![](../../assets/invitefromtwake.gif)
You can also invite users from the console :
[users](../console/users.md)
@@ -0,0 +1,70 @@
---
description: How rights are managed on Twake
---
# Rights
Twake has several levels of rights. Users belong to one or more workspaces within the company. They can have different statuses inherent to their membership to the company or workspace
## Owner
He's the main administrator of the whole company. He can:
- Allow connectors and applications to be installed in workspaces
- Change the corporate identity
- Giving/withdrawing the right "Owner of the company" to a member of the company
The creator of the company is the only owner. You can not change this role. Only the creator can be owner of the company.
## Admin
An admin has the same right than the owner. He can:
- Allow connectors and applications to be installed in workspaces
- Change the corporate identity
- Giving/withdrawing the right "Owner of the company" to a member of the company
The creator of the company is the only owner. You can not change this role. Only the creator can be owner of the company.
To grant the admin right, open the console \([https://console.twake.app](https://console.twake.app)\). Open `Users` section and `Edit` the member you want to set admin. Update the Role with `Admin` and save.
![](../../assets/setadmin.gif)
## Workspace administrator
He's the team administrator. He has the same rights as a user. In addition, he can:
- Add/remove connectors and applications in the workspace
- Changing the identity of the workspace
- Adding members to the workspace
- Delete workspace
By default, the creator of the workspace is the administrator. This right can be cumulated with that of a company administrator.
To grant the workspace level, open your workspace collaborators page, and select `Administrator`
![](../../assets/setwsadmin.gif)
## User
The "user" right is the default right of a member in a workspace. It can :
- Read and send messages to public and private chat channels \(to which he has been invited\)
- Create, modify, delete documents from the drive
- Create, edit, delete events and calendars
- Create, modify, delete tables and tasks Invite users to the workspace
- Create a workspace within the company
It's a default right. If the collaborator is not Company or Workspace administrator and he is not a Guest user, he is a simple User
## Guest
This status is intended for external partners working on a specific topic with the team. Guest user can :
- Talk in the channel where they are invited
They can not join by themself any channel \(even public\). They need to be invited by a normal user.
To set the Guest level, open the console \([https://console.twake.app](https://console.twake.app)\) and the users page. Set the user's role to "Guest".
![](../../assets/setguest.gif)
@@ -0,0 +1,12 @@
---
description: How to use the Twake console
---
# 🧰 Console
The console is where you can manage your company and all information shared on Twake, LinShare and more.
@@ -0,0 +1,36 @@
---
description: How users are managed in the Twake console
---
# Users
As user admin, you have access to the user management page.
Open the console : [https://console.twake.app/](https://console.twake.app/) and open the page "Users".
![User management page](../../assets/image-2.png)
## Add a user
To work with your colleagues in your company, you have 2 choices :
- Create user account
- Invite them by email
You can also invite users from the chat :
[invite-user-from-chat](../company-and-workspace/invite-user-from-chat.md)
### Send email invitation
To send an invitation, you can click on `Add user` &gt; `Invite users`.Enter emails you want to invite separated with coma. After validation, an email is sent to this address. Your colleagues will have a link to signup and join your company.
![Invite user](../../assets/inviteuser.gif)
### Create user account
You can create directly accounts for your colleagues. For that, click on `Add user` &gt; `Create account`. After giving email, name and Role, you can specify a password \(or generate a random one\). You just have to send credentials to your teammate.
![](../../assets/createuser.gif)
## Manage user
@@ -0,0 +1,32 @@
---
description: "Yes, we have desktop and mobile apps !"
---
# 🖥 Desktop and mobile app
## Desktop
You can download Twake for Mac, Windows, Linux here: [https://github.com/linagora/Twake-Desktop/tree/master/download](https://github.com/linagora/Twake-Desktop/tree/master/download)
Click on the version according your OS, and click on "download" to get the desktop application.
![](<../assets/image-(3)-(1).png>)
### Switch to on-premise servers
On the desktop app, you can use the following options to change your server:
• On MacOS, click on Help &gt; Change Twake Server
• On Windows, MacOS and Linux, use the shortcut CTRL+ALT+SHIFT+S or CMD+ALT+SHIFT+S
## Mobile App
The mobile app is available on iOS App Store and Android Play Store.
### Switch to on-premise servers
On the mobile app, just log out and you should be able to change the server from the bottom left login page link "Change Server".
#### Push notifications on the on-premise mobile app
This feature is not yet available, say you want this feature using a "thumbs up" emoji here: [https://github.com/TwakeApp/Twake/issues/130](https://github.com/TwakeApp/Twake/issues/130)
@@ -0,0 +1,102 @@
# 🔒 Privacy
You will find everything related to privacy in this document [https://twake.app/en/privacy/](https://twake.app/en/privacy/).
At Twake we are committed to protecting your privacy. We implemented specific security features to ensure that your data is safe and secure.
## General presentation of Twake
Twake is available in two main versions :
- SaaS : Twake as a service (SaaS available on twake.app)
- On-Premise : Twake on-premise (on private servers or on dedicated servers managed by
Twake)
The Twake SaaS version is hosted in France by a French infrastructure provider. All servers are located in Paris (UE).
The Twake On-Premise version can be deployed on any local server and can work fully disconnected from the Internet or with an unique and unidirectional connection to twake.app for licencing management, mailing and iOS and Android push notifications (that are not available without additional configuration in fully disconnected mode).
On SaaS version, Twake provide two main tiers softwares :
- ONLYOFFICE spreadsheet, ONLYOFFICE document and ONLYOFFICE presentation, https://
onlyoffice.com
- Jitsi video-conferencing, https://jitsi.org/
On the On-Premise version those softwares are optionals.
## Quick FAQ about Twake security
#### Where are your servers ?
Twake servers are all in France, in Paris.
#### Are you GRPD compliant ?
Yes ! As you can see in this document, we do everything we can do to protect your personal and professional data. Concerning your password and personal data specifically, passwords are hashed using PBKDF2, your data is encrypted before to be sent to the database (encryption at rest on the application layer) and we use TLS.0 for communications (encryption on transit). Moreover, we do not require any personal data in order for you to use our software, you can use Twake without disclosing personal information.
#### What protocol do you use ?
We use HTTPS for unidirectional traffic encryption and WSS for bidirectional realtime traffic encryption. Passwords are hashed with PBKDF2. Files are encrypted with OpenSSL AES-256-CBC with a key composed of three parts stored in database, in code and in the server configuration. Finally our database data is encrypted with OpenSSL AES-256-CBC. In order to always improve our security, next version of Twake will include full end-to-end encryption for direct and private channels using the Matrix protocol.
#### How do you manage backups ?
We backup our encrypted database and your encrypted documents in a replicated Object Storage. We keep a backup of each month and a backup of each of the last seven days.
#### What if I want to export all my data ?
We do not provide an export feature on the software itself. But we have the ability to export your data on-demand, please contact us for more information.
#### Can I delete my account and erase my data ?
Yes, you can delete your account and erase your data. To proceed, open your account from the "console" and click on "Delete my account". You will be asked to confirm your choice. Once your account is deleted, you will not be able to access it anymore.
#### How do you manage security with tiers applications and modules ?
We cannot guarantee the security of the data you send to tiers applications and modules. If you work with an external app like Zapier or Giphy, they will have access to some of your information. You can see the access scope of an application before to add it to your company.
## High availability
Twake is built on scalable technologies and allow us to scale to million users but also to be fault tolerant. We define two kind of replication, hardware replication and software replication:
Hardware replication in case of hard disk crash or network issue is managed by our infrastructure provider, you will find more details on how they manage this following these links:
- Servers: https://www.ovhcloud.com/en/public-cloud/
- Object storage and backups: https://www.ovhcloud.com/en/public-cloud/object-storage/
Software replication is done by ourself. Each middleware and nodes used by Twake are replicated at least three time. In the rare case of node failure, our system automatically alerts us and start using the remaining available node until we operate and fix the broken one.
## Application encryption
Data are stored encrypted in ScyllaDB and searchable entities will be stored in Elastic Search.
#### ScyllaDB
Any data (except non-sensible data like identifiers, dates and counters) stored in ScyllaDB is encrypted using OpenSSL AES-256-CBC before being sent to the database.
#### Indexed search storage
We provide advanced search features to our product Twake using Elastic Search to index our entities. Entities are not stored in Elastic Search and only indexes will be available if Twake Elastic Search servers are compromised.
## Other
#### Random token generation
For random generation we use the PHP built-in random_bytes function with bin2hex if needed on PHP side and the crypto library with randomBytes from NodeJS and frontend side.
#### Passwords storage and authentication
Passwords are not stored in clear, only a hash of it is stored in database. We use the hash_pbkdf2 method with a randomly generated salt for each user.
#### SQL Injection
Each database access use Doctrine ORM sanitisation before write or reads, we never use custom access to the database to reduce risks of injection. We developed a middleware to use ScyllaDB databases but this middleware works after Doctrine ORM sanitisation.
On NodeJS, we also implemented an ORM for all database access in order to keep this level of security.
#### XSS
We use React as front-end framework and we never execute tiers Javascript. External apps are loaded in webviews or iframes and use a bridge designed like a router for data exchange between frames.
## Continuous security checks
- We use Snyk to ensure that our dependencies are up to date and secure.
- We are active on huntr.dev to ensure that we fix all security issues reported by the community.
@@ -0,0 +1,10 @@
---
description: Discover how to use Twake
---
# 👋 Welcome to Twake !
Twake is an open source collaborative workspace. It can be self-hosted, used is saas and easily integrated into your teams. Twake offers all the features for collaboration : team chat, file storage, team calendar, tasks manager.
In this chapter, you'll find how to use Twake.
+45
View File
@@ -0,0 +1,45 @@
# ☀️ Welcome to Twake
Twake is an open source collaborative workspace. It can be self-hosted, used is saas and easily integrated into your teams. Twake offers all the features for collaboration : team chat, file storage, team calendar, tasks manager.
This **documentation** assists developers and users in having the best Twake experience as possible. Weve developed Twake to have a better teamwork.
---
# 🌎 Use Twake on twake.app
#### Start using Twake now
To use Twake online it is simple, just go on [twake.app](https://twake.app) and click "Sign up".
> Want to install it on your own server ? [It is here](onprem/installation.md)).
#### Now, you can learn how to become a Twake super-user
> Learn how to become a power user of Twake: [welcome.md](./how-to-use-it/welcome.md)
> If you want to see the latest updates you can go here: [https://github.com/linagora/Twake/blob/main/changelog.md](https://github.com/linagora/Twake/blob/canary/changelog.md)
## Use the canary version to try out new features
You want to try the latest features from Twake before they come out to production? You can!
We have a server called Canary that will give you access to new features 1 month before their official releases. This server is compatible with the classic server so it means you can still discuss with your team even if you are the only one using the canary server.
The goal of the canary server it to do additional testing with a larger set of users, so if you encounter any issue, please notify us to help us fix the version before to ship it on production.
When using the canary server, the best is to set it up on all your devices like so:
#### How to use it on my browser
Just go to [canary.twake.app](https://canary.twake.app) instead of web.twake.app.
#### How to use it on the desktop app
Press Shift+Alt+Command or Shift+Ctrl+Alt to open the "Change server url" popup then enters [https://canary.twake.app](https://canary.twake.app) in the input then press OK.
#### How to use it on the mobile app
Logout from the mobile app, click on Change server and put [https://canary.twake.app](https://canary.twake.app) then login.
> If you want to see the latest updates on the **canary** server you can go here: [https://github.com/linagora/Twake/blob/canary/changelog.md](https://github.com/linagora/Twake/blob/canary/changelog.md)
@@ -0,0 +1,36 @@
---
description: >-
This page will document all the services implemented in the new NodeJS
backend. For all the PHP services not yet migrated, please ask us directly on
https://community.twake.app/
---
# 🧱 Backend and APIs
## Twake Services
As a frontend developer / connector developer to read our APIs, or to understand our data models or just for fun, here is all the details over Twake backend services.
If document are empty, check out our Notion documentation: [https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/twake/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
### Services
[users/](users/README.md)
[applications/](applications/README.md))
[channels/](channels/README.md))
[messages/](messages/README.md))
[notifications/](notifications/README.md))
## Get started to code in Twake
Want to edit Twake code ? Congratulation ! You participate in the development of a great product 😃
[start-working-into-a-service](intro/start-working-into-a-service.md)
[create-a-new-twake-service](intro/create-a-new-twake-service.md)
[intro/platform/](intro/platform/README.md))
@@ -0,0 +1,22 @@
---
description: How applications are managed in Twake backend
---
# 🍎 Applications
#### Description
**Applications** is everything related to connectors in Twake.
An application is described by an identity sheet containing this information:
- **Identity** \(name, description, logo\)
- **API** **preferences** \(Twake→Connector events endpoint, API id and secret, and Connector→Twake allowed IPs\)
- **Privileges and capabilities** \(List of things the connector can read and can write\)
- **Display information** \(Where the connector is visible, button in chat, configuration in application list etc\)
This is all we need to define a connector.
[database-models](database-models.md)
[rest-apis](rest-apis.md)
@@ -0,0 +1,130 @@
---
description: Application models for backend
---
# Database models
**applications**\
****Represent an application in the database
```javascript
{
//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
```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 Twake
}
```
@@ -0,0 +1,6 @@
---
description: Rest API for application
---
# REST APIs
@@ -0,0 +1,40 @@
---
description: >-
Channels are topics in Twake, users can subscribe to them, can make them
private or can create them.
---
# 🎩 Channels and tabs
### Wording
**Member:** member in company without the tag "guest"
**Guest:** company member with the tag "guest"
**Channel member:** member in the channel
**Channels types:
→ Private:** Relative to a workspace but restricted to a defined group of members
**→ Public:** Relative to a workspace anyone can find the channel and join
**→ Direct:** Relative to a company, a discussion between a set of members but without defined topic
**To understand the routing** please read **"**Collections based rest api:" in "Wording and formating"
TODO [Wording and formatting](https://www.notion.so/Wording-and-formatting-24ef27e094a042aea4899ac6a8039dee)
### What it does
Channel component is **not** responsible of the red badge counter \(notification service is\).
Channel component **is** responsible of keeping track of the message from where the user need to start reading but can be override by notification service if there is a mention to start reading from.
TODO [Some process details and constant s](https://www.notion.so/Some-process-details-and-constant-s-fb5b2d4974da490aa87bb87082af8454)
### Models an APIs
[Database models](database-models.md)
TODO [REST Api / Websockets Api](https://www.notion.so/REST-Api-Websockets-Api-458b153a6a6e46c2925dfc1db3859d3b)
TODO [In/Out microservice](https://www.notion.so/In-Out-microservice-e721e72e542244a69ca3a913e0b405ad)
TODO [Activity models](https://www.notion.so/Activity-models-0fa3acb0a13f41fd98bc98709908eedf)
@@ -0,0 +1,152 @@
---
description: Database models of channel
---
# Database models
## Channels
#### **channels**
The main channel table, this table should only be used when changing things on the channel \(not frequently\) so we don't add counters or last\_activity or anything like that.
```javascript
{
//Primary key
"company_id": "uuid-v4",
"workspace_id": "string" // ("uuid-v4" | "direct")
"id": "uuid-v4",
//Content
"owner": "uuid-v4", //User-id of the channel owner (invisible but used on some access restriction-
"icon": "String",
"name": "String",
"description": "String",
"channel_group": "String",
"visibility": "private" | "public" | "direct"
"default": true | false, //The new members join by default this channel
"archived": false | true,
"archivation_date": 0, //Timestamp
}
```
#### **channel\_defaults**
Contain the default channels
```javascript
{
//Primary key
"company_id": "uuid-v4",
"workspace_id": "uuid-v4"
"id": "uuid-v4" //Channel id
}
```
#### **channel\_counters**
We use a separated table to manage counters for this channel. Currently this is not used to do statistics but can be used to this goal in the future.
```javascript
{
//Primary key
"company_id": "uuid-v4",
"workspace_id": "string", // "uuid-v4" | "direct"
"channel_id": "uuid-v4",
"type": "members" | "guests" | "messages",
"value": 0,
}
```
#### **channel\_last\_activity**
Store last channel activity for bold/not bold management
```javascript
{
//Primary key
"company_id": "uuid-v4",
"channel_id": "uuid-v4",
"last_activity": 0, //Timestamp in seconds
}
```
#### **direct\_channel\_identifiers**
This table is used to find an existing discussion with a group of members. The "identifier" is generated from the group of members.
```javascript
{
//Primary key
"company_id": "uuid-v4",
"identifier": "string", // ordered CSV list of user ids
"channel_id": "uuid-v4" //A way to find it in the channel table
}
```
## **Channels tabs**
#### **channel\_tabs**
Channels can have tabs that are connexion to other apps or different views.
```javascript
{
//Primary key
"company_id": "uuid-v4",
"workspace_id": "string", // "uuid-v4" | "direct"
"channel_id": "uuid-v4",
"tab_id": "uuid-v4",
"name": "String",
"configuration": JSON,
"application_id": "uuid-v4",
"owner": "uuid-v4",
"order": "string"
}
```
## **Channels members**
#### **channel\_members**
List of channels for an user
```javascript
{
//Primary key
"company_id": "uuid-v4", //Partition Key
"workspace_id": "string", // "uuid-v4" | "direct", //Clustering key
"user_id": "uuid-v4",
"channel_id": "uuid-v4",
"type": "member" | "guest" | "bot",
"last_access": 0, //Timestamp in seconds
"last_increment": 0, //Number
"favorite": false | true, //Did the user add this channel to its favorites
"notification_level": "all" | "none" | "group_mentions" | "user_mentions",
"expiration": false | Timestamp, //Member expiration in channel (only for guests)
}
```
#### **channel\_members\_reversed**
List of users in channel
**Not implemented:** We need to ensure this replication regularly \(on each user open channel\) ?
```javascript
{
//Primary key
"company_id": "uuid-v4",
"workspace_id": "string", // "uuid-v4" | "direct",
"channel_id": "uuid-v4",
"type": "guest" | "bot" | "member",
"user_id": "uuid-v4",
}
```
@@ -0,0 +1,26 @@
---
description: Drive on Twake
---
# 📁 Drive
## description
**Drive** or **Documents** is the Nodejs drive implementation for twake, it contains drive items.
A **Drive item** can be:
- a file
- a directory
- the root folder
- the trash
## wording
**version** each file in the drive has a version associated to each update.
## Models and APIs
[database-models](database-models.md)
[rest-api](rest-apis.md)
@@ -0,0 +1,86 @@
---
description: Documents database models
---
# Database models
**DriveFile**
```javascript
{
// Primary Key
"company_id": uuid;
"id": uuid;
"parent_id": string;
"is_in_trash": boolean;
"is_directory": boolean;
"name": string;
"extension": string;
"description": string;
"tags": string[];
"added": string;
"last_modified": string;
"access_info": AccessInformation;
"content_keywords": string;
"hidden_data": unknown;
"last_version_cache": Partial<FileVersion>;
}
type AccessInformation = {
public: {
token: string;
level: publicAccessLevel;
};
entities: AuthEntity[];
};
type AuthEntity = {
type: "user" | "channel" | "company" | "folder";
id: string | "parent";
level: publicAccessLevel | DriveFileAccessLevel;
};
```
**FileVersion**
```javascript
{
"id": string;
"provider": "internal" | "drive" | string;
"file_id": string;
"file_metadata": DriveFileMetadata;
"date_added": number;
"creator_id": string;
"application_id": string;
"realname": string;
"key": string;
"mode": string | "OpenSSL-2";
"file_size": number;
"filename": string;
"data": unknown;
}
type DriveFileMetadata = {
source: "internal" | "drive" | string;
external_id: string;
name?: string;
mime?: string;
size?: number;
thumbnails?: DriveFileThumbnail;
};
type DriveFileThumbnail = {
index: number;
id: string;
type: string;
size: number;
width: number;
height: number;
url: string;
full_url?: string;
};
```
@@ -0,0 +1,360 @@
---
description: Documents API
---
# Authentication
All the following routes require the usual authentication header. But you can also use other ways of authentication:
- For the download routes, you can use a token generated by the `/internal/services/documents/v1/companies/:company_id/download/token` route (see bellow).
- All the routes can use a query string `?public_token=token` to authenticate the user.
- All the routes can use a query string `?twake_tab_token=token` to authenticate the user in the context of a channel tab for instance.
# Navigation and drive capabilities
## Fetch a drive item
Used to fetch a drive item
**URL** : `/internal/services/documents/v1/companies/:company_id/item/:id`
**Method** : `GET`
**Auth required** : Yes
### Success Response
**Code** : `200 OK`
**Content example**
```javascript
{
item: {
id: string;
company_id: string;
parent_id: string;
in_trash: boolean;
is_directory: string;
name: string;
extension: string;
description: string;
tags: [];
added: string;
last_modified: string;
last_version_cache: DriveItemVersion;
access_info: DriveItemAccessInfo;
}
versions: {
id: string;
provider: string | "drive" | "internal";
file_id: string;
file_metadata: FileMetadata;
date_added: number;
creator_id: string;
application_id: string;
}
[];
children: {
id: string;
company_id: string;
parent_id: string;
in_trash: boolean;
is_directory: string;
name: string;
extension: string;
description: string;
tags: [];
added: string;
last_modified: string;
last_version_cache: DriveItemVersion;
access_info: DriveItemAccessInfo;
}
[];
}
```
### Error Responses
If the item cannot be fetched the server will return an error with one of the following status codes:
- 401 Unauthorized - The user is not authorized.
- 500 Internal Server Error - An error occurred while performing the operation.
## Create a drive item
Used to create a drive item
**URL** : `/internal/services/documents/v1/companies/:company_id/item`
**Method** : `POST`
**Headers**: `Content-Type: application/json` OR `Content-Type: multipart/form-data`
**Auth required** : Yes
**Data constraints**
```javascript
{
item: {
id: string;
company_id: string;
parent_id: string;
in_trash: boolean;
is_directory: string;
name: string;
extension: string;
description: string;
tags: [];
added: string;
last_modified: string;
last_version_cache: DriveItemVersion;
access_info: DriveItemAccessInfo;
},
version: {
id: string;
provider: string | 'drive' | 'internal';
file_id: string;
file_metadata: FileMetadata;
date_added: number;
creator_id: string;
application_id: string;
},
file?: File // The multipart/form-data file to be uploaded ( optional )
}
```
### Success Response
**Code** : `200 OK`
### Error Responses
If the request is missing required fields or the item cannot be created, the server will return an error with one of the following status codes:
- 400 Bad Request - The request is missing required fields.
- 401 Unauthorized - The user is not authorized.
- 500 Internal Server Error - An error occurred while performing the operation.
## Update a drive item
Used to update a drive item
**URL** : `/internal/services/documents/v1/companies/:company_id/item/:id`
**Method** : `POST`
**Auth required** : Yes
**Data constraints**
```javascript
{
id: string;
company_id: string;
parent_id: string;
in_trash: boolean;
is_directory: string;
name: string;
extension: string;
description: string;
tags: [];
added: string;
last_modified: string;
last_version_cache: DriveItemVersion;
access_info: DriveItemAccessInfo;
}
```
### Success Response
**Code** : `200 OK`
### Error Responses
If the request is missing required fields or the item cannot be updated, the server will return an error with one of the following status codes:
- 400 Bad Request - The request is missing required fields.
- 401 Unauthorized - The user is not authorized.
- 500 Internal Server Error - An error occurred while performing the operation.
## Delete a drive item
Used to delete a drive item
**URL** : `/internal/services/documents/v1/companies/:company_id/item/:id`
**Method** : `DELETE`
**Auth required** : Yes
### Success Response
**Code** : `200 OK`
## Create a drive item version
Used to create a drive item version
**URL** : `/internal/services/documents/v1/companies/:company_id/item/:id/version`
**Method** : `POST`
**Auth required** : Yes
**Data constraints**
```javascript
{
id: string;
provider: string | 'drive' | 'internal';
file_id: string;
file_metadata: {
source: 'internal' | 'drive' | string;
external_id: string | any;
name?: string;
mime?: string;
size?: number;
thumbnails?: {
index: number;
id: string;
type: string;
size: number;
width: number;
height: number;
url: string;
full_url?: string;
}[];
};
date_added: number;
creator_id: string;
application_id: string;
}
```
### Success Response
**Code** : `200 OK`
# Download
## Get a download token
Before to download, if you can't pass an authorisation token (for example in the browser context) you can generate a token that you will pass in the query string to download the file using the next routes.
**URL** : `/internal/services/documents/v1/companies/:company_id/item/download/token?items=id1,id2,id3&version_id:optional_id`
**Method** : `GET`
**Auth required** : Yes
### Success Response
```
{
"token": string
}
```
## Download
Shortcut to download a file (you can also use the file-service directly).
If the item is a folder, a zip will be automatically generated.
**URL** : `/internal/services/documents/v1/companies/:company_id/item/:id/download?version_id=:optional_id`
**Method** : `GET`
**Auth required** : Yes
## Zip download
Used to create a zip archive containing the requested drive items ( files and folders ).
**URL** : `/internal/services/documents/v1/companies/:company_id/item/download/zip?items=id1,id2,id3`
**Method** : `GET`
**Auth required** : Yes
# Tabs (for Twake)
If you want to use the Twake tabs, you must store the configuration of the tabs in the database.
## Get tab configuration
Get a tab configuration to get the attached folder/document id.
**URL** : `/internal/services/documents/v1/companies/:company_id/tabs/:id`
**Method** : `GET`
**Auth required** : Yes
### Success Response
```
{
"company_id": string;
"tab_id": string;
"channel_id": string;
"item_id": string;
"level": "read" | "write";
}
```
## Set tab configuration
Get a tab configuration to get the attached folder/document id.
**URL** : `/internal/services/documents/v1/companies/:company_id/tabs/:id`
**Method** : `POST`
**Auth required** : Yes
**Data constraints** :
```
{
"company_id": string;
"tab_id": string;
"channel_id": string;
"item_id": string;
"level": "read" | "write";
}
```
### Success Response
```
{
"company_id": string;
"tab_id": string;
"channel_id": string;
"item_id": string;
"level": "read" | "write";
}
```

Some files were not shown because too many files have changed in this diff Show More