📝Updated documentation for the backend services
This commit is contained in:
committed by
Anton Shepilov
parent
904b767382
commit
3cf164787f
@@ -1 +1,4 @@
|
||||
# Get started
|
||||
::: info
|
||||
This paragraph is not ready yet, you can contribute to this documentation on our [Github!](https://github.com/linagora/twake-drive/issues/546)
|
||||
:::
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
# ☀️ Welcome to Twake Drive
|
||||
|
||||
Twake Drive is an open source collaborative drive. It can be self-hosted, used is saas and easily integrated into your teams. Twake Drive offers all the features for collaboration : team chat, file storage, team calendar, tasks manager.
|
||||
Twake Drive is an open source collaborative drive. It can be self-hosted,
|
||||
used is saas and easily integrated into your teams.
|
||||
Store all your files and folders securely, whether in the cloud or your server,
|
||||
and share them with your partners and team. Twake Drive prioritizes the confidentiality
|
||||
and integrity of your data at all times. All that you expect from file storage,
|
||||
plus privacy and elegant interface
|
||||
|
||||
This **documentation** assists developers and users in having the best Twake Drive experience as possible. We’ve developed Twake Drive to have a better teamwork.
|
||||
This **documentation** assists developers and users in having the best Twake Drive experience as possible.
|
||||
We’ve developed Twake Drive to have a better teamwork.
|
||||
|
||||
---
|
||||
|
||||
#### Start using Twake Drive now
|
||||
|
||||
Install it on your own server: [click here](onprem/installation.md)).
|
||||
Install it on your own server: [click here](onprem/installation.md)
|
||||
|
||||
#### Add plugins like OnlyOffice
|
||||
#### Add plugins like OnlyOffice [click here](plugins.md)
|
||||
|
||||
#### Developer documentation [click here](internal-documentation/backend-services/README.md)
|
||||
|
||||
[click here](plugins.md)).
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
---
|
||||
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.tdrive.app/
|
||||
backend.
|
||||
---
|
||||
|
||||
# 🧱 Backend and APIs
|
||||
@@ -13,17 +12,23 @@ As a frontend developer / connector developer to read our APIs, or to understand
|
||||
|
||||
If document are empty, check out our Notion documentation: [https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
|
||||
|
||||
### General
|
||||
|
||||
#### Authentication
|
||||
[TODO](https://github.com/linagora/twake-drive/issues/544)
|
||||
|
||||
### Services
|
||||
|
||||
[users/](users/README.md)
|
||||
|
||||
[applications/](applications/README.md))
|
||||
|
||||
[channels/](channels/README.md))
|
||||
[documents/](documents/README.md))
|
||||
|
||||
[messages/](messages/README.md))
|
||||
[files/](files/README.md))
|
||||
|
||||
[tags/](tags/README.md))
|
||||
|
||||
[notifications/](notifications/README.md))
|
||||
|
||||
## Get started to code in Twake Drive
|
||||
|
||||
@@ -31,6 +36,6 @@ Want to edit Twake Drive code ? Congratulation ! You participate in the developm
|
||||
|
||||
[start-working-into-a-service](intro/start-working-into-a-service.md)
|
||||
|
||||
[create-a-new-tdrive-service](intro/create-a-new-tdrive-service.md)
|
||||
[create-a-new-tdrive-service](intro/create-a-new-twake-service.md)
|
||||
|
||||
[intro/platform/](intro/platform/README.md))
|
||||
|
||||
@@ -13,10 +13,12 @@ An application is described by an identity sheet containing this information:
|
||||
- **Identity** \(name, description, logo\)
|
||||
- **API** **preferences** \(TDrive→Connector events endpoint, API id and secret, and Connector→TDrive 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\)
|
||||
- **Display information** \(Where the connector is visible, configuration in application list etc\)
|
||||
|
||||
This is all we need to define a connector.
|
||||
|
||||
[database-models](database-models.md)
|
||||
|
||||
[rest-apis](rest-apis.md)
|
||||
|
||||
[examples](examples.md)
|
||||
|
||||
+23
-71
@@ -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,7 +61,7 @@ type ApplicationDisplay = {
|
||||
tdrive: {
|
||||
"version": 1,
|
||||
|
||||
"files" : {
|
||||
"files": {
|
||||
"preview": {
|
||||
"url": "", //Url to preview file (full screen or inline)
|
||||
"inline": true,
|
||||
@@ -69,60 +74,7 @@ type ApplicationDisplay = {
|
||||
"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 TDrive
|
||||
}
|
||||
```
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# Twake Drive Application Example
|
||||
::: info
|
||||
This paragraph is not ready yet, you can contribute to this documentation on our [Github!](https://github.com/linagora/twake-drive/issues/548)
|
||||
:::
|
||||
+3
-1
@@ -3,4 +3,6 @@ description: Rest API for application
|
||||
---
|
||||
|
||||
# REST APIs
|
||||
|
||||
::: info
|
||||
This paragraph is not ready yet, you can contribute to this documentation on our [Github!](https://github.com/linagora/twake-drive/issues/547)
|
||||
:::
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
::: info
|
||||
This paragraph is not ready yet, you can contribute to this documentation on our Github!
|
||||
:::
|
||||
@@ -2,11 +2,11 @@
|
||||
description: Drive on TDrive
|
||||
---
|
||||
|
||||
# 📁 Drive
|
||||
# 📁 Documents
|
||||
|
||||
## description
|
||||
|
||||
**Drive** or **Documents** is the Nodejs drive implementation for tdrive, it contains drive items.
|
||||
**Documents** is the Nodejs drive implementation for tdrive, it contains drive items.
|
||||
|
||||
A **Drive item** can be:
|
||||
|
||||
|
||||
+35
-34
@@ -6,25 +6,25 @@ description: Documents 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>;
|
||||
```TypeScript
|
||||
export class DriveFile {
|
||||
company_id: string;
|
||||
id: string;
|
||||
parent_id: string;
|
||||
is_in_trash: boolean;
|
||||
is_directory: boolean;
|
||||
name: string;
|
||||
extension: string;
|
||||
description: string;
|
||||
tags: string[];
|
||||
added: number;
|
||||
last_modified: number;
|
||||
access_info: AccessInformation;
|
||||
content_keywords: string;
|
||||
creator: string;
|
||||
size: number;
|
||||
last_version_cache: Partial<FileVersion>;
|
||||
scope: DriveScope;
|
||||
}
|
||||
|
||||
type AccessInformation = {
|
||||
@@ -46,23 +46,24 @@ type AuthEntity = {
|
||||
|
||||
**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;
|
||||
```Typescript
|
||||
export class FileVersion {
|
||||
drive_item_id: string;
|
||||
id: string;
|
||||
provider: "internal" | "drive" | 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;
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
description: Documents API
|
||||
---
|
||||
|
||||
# Authentication
|
||||
<!-- TODO[NOT UP TO DATE] -->
|
||||
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 `?tdrive_tab_token=token` to authenticate the user in the context of a channel tab for instance.
|
||||
|
||||
# Navigation and drive capabilities
|
||||
|
||||
## Fetch a drive item
|
||||
|
||||
@@ -3,10 +3,9 @@ description: File on Twake Drive
|
||||
---
|
||||
|
||||
# 📄 Files
|
||||
<!-- TODO[NOT UP TO DATE] -->
|
||||
## description
|
||||
|
||||
**Files** is everything related to file upload in Twake Drive after the migration to Node.js. Note that the Twake Drive isn't part of this migration because it will be replaced by Linshare.
|
||||
**Files** is everything related to file upload in Twake Drive.
|
||||
|
||||
Twake Drive Files upload support chunk upload and file encryption.
|
||||
|
||||
@@ -18,7 +17,14 @@ Twake Drive Files upload support chunk upload and file encryption.
|
||||
|
||||
## Encryption
|
||||
|
||||
Files and Storage services in Twake Drive feature encryption at rest in **aes-256-cbc**.
|
||||
Files and Storage services in Twake Drive feature encryption at rest in **aes-256-gbc**. Or you can also set your desired algorithm is the Twake Drive configuration
|
||||
```JSON
|
||||
{
|
||||
"database": {
|
||||
"encryption": "DB_ENCRYPTION_ALGORITHM"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Each file is encrypted with two layers:
|
||||
|
||||
|
||||
+20
-32
@@ -1,40 +1,28 @@
|
||||
---
|
||||
description: File database models
|
||||
---
|
||||
<!-- TODO[NOT UP TO DATE] -->
|
||||
# Database models
|
||||
|
||||
* **files** The main file object in database
|
||||
|
||||
```javascript
|
||||
|
||||
javascript
|
||||
{
|
||||
|
||||
//Primary key: [["company_id"], "id"]
|
||||
"company_id": "uuid-v4",
|
||||
"id": "uuid-v4",
|
||||
"user_id": "string",
|
||||
"application_id": "string",
|
||||
"updated_at": "number",
|
||||
"created_at":"number
|
||||
|
||||
"upload_data": (json){
|
||||
"size": number, //Total file size
|
||||
"chunks": number, //Number of chunks
|
||||
```Typescript
|
||||
export class File {
|
||||
company_id: string;
|
||||
id: string;
|
||||
user_id: string;
|
||||
application_id: null | string;
|
||||
encryption_key: string;
|
||||
updated_at: number;
|
||||
created_at: number;
|
||||
metadata: null | {
|
||||
name?: string;
|
||||
mime?: string;
|
||||
thumbnails_status?: "done" | "error" | "waiting";
|
||||
};
|
||||
thumbnails: Thumbnail[];
|
||||
upload_data: null | {
|
||||
size: number;
|
||||
chunks: number;
|
||||
};
|
||||
}
|
||||
"metadata": (json){
|
||||
"name": "string", //File name
|
||||
"mime": "type/subtype",
|
||||
}
|
||||
"thumbnails": (json) { //Url to thumbnail (or set it to undefined if no relevant)
|
||||
"index": "string",
|
||||
"id": "uuid-v4",
|
||||
"type": "string",
|
||||
"size": "number,
|
||||
"width": number, //Thumbnail width (for images only)
|
||||
"height": number, //Thumbnail height (for images only)
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
@@ -6,6 +6,6 @@ description: Get started with Twake Drive service development
|
||||
|
||||
[start-working-into-a-service](start-working-into-a-service.md)
|
||||
|
||||
[create-a-new-tdrive-service](create-a-new-tdrive-service.md)
|
||||
[create-a-new-twake-drive-service](create-a-new-twake-service.md)
|
||||
|
||||
[platform/](platform/README.md)
|
||||
|
||||
+24
-21
@@ -17,7 +17,7 @@ In order to illustrate how to create a component, let's create a fake Notificati
|
||||
1. Create the folder `src/services/notification`
|
||||
2. Create an `index.ts` file which exports a `NotificationService` class
|
||||
|
||||
```javascript
|
||||
```Typescript
|
||||
// File src/services/notification/index.ts
|
||||
import { TdriveService } from "../../core/platform/framework";
|
||||
import NotificationServiceAPI from "./api.ts";
|
||||
@@ -37,7 +37,7 @@ export default class NotificationService extends TdriveService<NotificationServi
|
||||
|
||||
We need to create this `NotificationServiceAPI` interface which must extend the `TdriveServiceProvider` from the platform like:
|
||||
|
||||
```javascript
|
||||
```Typescript
|
||||
// File src/services/notification/api.ts
|
||||
import { TdriveServiceProvider } from "../../core/platform/framework/api";
|
||||
|
||||
@@ -52,7 +52,7 @@ export default interface NotificationServiceAPI extends TdriveServiceProvider {
|
||||
|
||||
1. Now that the interfaces are defined, we need to create the `NotificationServiceAPI` implementation \(this is a dummy implementation which does nothing but illustrates the process\):
|
||||
|
||||
```javascript
|
||||
```Typescript
|
||||
// File src/services/notification/services/api.ts
|
||||
import NotificationServiceAPI from "../api";
|
||||
|
||||
@@ -69,7 +69,7 @@ export class NotificationServiceImpl implements NotificationServiceAPI {
|
||||
2. `public async doInit(): Promise<this>;` Customize the `init` step of the component. This is generally the place where services are instanciated. From this step, you can retrieve services consumed by the current component which have been already initialized by the platform.
|
||||
3. `public async doStart(): Promise<this>;` Customize the `start` step of the component. You have access to all other services which are already started.
|
||||
|
||||
```javascript
|
||||
```Typescript
|
||||
// File src/services/notification/index.ts
|
||||
import { TdriveService } from "../../core/platform/framework";
|
||||
import NotificationServiceAPI from "./api.ts";
|
||||
@@ -94,7 +94,7 @@ export default class NotificationService extends TdriveService<NotificationServi
|
||||
|
||||
1. Now that the service is fully created, we can consume it from any other service in the platform. To do this, we rely on Typescript decorators to define the links between components. For example, let's say that the a `MessageService` needs to call the `NotificationServiceAPI`, we can create the link with the help of the `@Consumes` decorator and get a reference to the `NotificationServiceAPI` by calling the `getProvider` on the component context like:
|
||||
|
||||
```javascript
|
||||
```Typescript
|
||||
import { TdriveService, Consumes } from "../../core/platform/framework";
|
||||
import MessageServiceAPI from "./providapier";
|
||||
import NotificationServiceAPI from "../notification/api";
|
||||
@@ -115,26 +115,29 @@ export default class MessageService extends TdriveService<MessageServiceAPI> {
|
||||
The platform and services configuration is defined in the `config/default.json` file. It uses [node-config](https://github.com/lorenwest/node-config) under the hood and to configuration file inheritence is supported in the platform.
|
||||
|
||||
The list of services to start is defined in the `services` array like:
|
||||
<!-- TODO[NOT UP TO DATE] -->
|
||||
```javascript
|
||||
```JSON
|
||||
{
|
||||
"services": ["auth", "user", "channels", "webserver", "websocket", "database", "realtime"]
|
||||
"services": ["auth", "user", "channels", "webserver", "database"]
|
||||
}
|
||||
```<!-- TODO[NOT UP TO DATE] -->
|
||||
```
|
||||
|
||||
Then each service can have its own configuration block which is accessible from its service name i.e. `websocket` service configuration is defined in the `websocket` element like:
|
||||
Then each service can have its own configuration block which is accessible from its service name i.e. `storage` service configuration is defined in the `storage` element like:
|
||||
|
||||
```javascript
|
||||
```JSON
|
||||
{
|
||||
"services": ["auth", "user", "channels", "webserver", "websocket", "orm"],
|
||||
"websocket": {
|
||||
"path": "/socket",
|
||||
"adapters": {
|
||||
"types": [],
|
||||
"redis": {
|
||||
"host": "redis",
|
||||
"port": 6379
|
||||
}
|
||||
"services": ["auth", "user", "webserver", "storage"],
|
||||
"storage": {
|
||||
"type": "S3",
|
||||
"S3": {
|
||||
"endPoint": "play.min.io",
|
||||
"port": 9000,
|
||||
"useSSL": false,
|
||||
"accessKey": "ABCD",
|
||||
"secretKey": "xyz",
|
||||
"disableRemove": false
|
||||
},
|
||||
"local": {
|
||||
"path": "/tdrive"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -142,7 +145,7 @@ Then each service can have its own configuration block which is accessible from
|
||||
|
||||
On the component class side, the configuration object is directly accessible from the `configuration` property like:
|
||||
|
||||
```javascript
|
||||
```Typescript
|
||||
export default class WebSocket extends TdriveService<WebSocketAPI> {
|
||||
async doInit(): Promise<this> {
|
||||
// get the "path" value, defaults to "/socket" if not defined
|
||||
|
||||
@@ -7,8 +7,7 @@ description: >-
|
||||
# Platform/Technical services
|
||||
|
||||
## **Database Technical Service**
|
||||
<!-- TODO[NOT UP TO DATE] -->
|
||||
Twake Drive uses a custom ORM to work with both MongoDB and CassandraDB/ScyllaDB.
|
||||
Twake Drive uses a custom ORM to work with both MongoDB and PostgreSQL.
|
||||
|
||||
::: info
|
||||
This paragraph is not ready yet, you can contribute to this documentation on our Github!
|
||||
|
||||
@@ -7,7 +7,11 @@ description: >-
|
||||
# Platform/Technical services
|
||||
|
||||
## **Database Technical Service**
|
||||
<!-- TODO[NOT UP TO DATE] -->
|
||||
Twake Drive uses a custom ORM to work with both MongoDB and CassandraDB/ScyllaDB.
|
||||
Twake Drive uses a custom ORM to work with both MongoDB and PostgreSQL.
|
||||
|
||||
[database-orm-platform-service](database-orm-platform-service.md)
|
||||
::: info
|
||||
This paragraph is not ready yet, you can contribute to this documentation on our [Github](https://github.com/linagora/twake-drive/issues/545)!
|
||||
:::
|
||||
|
||||
|
||||
|
||||
+6
-6
@@ -48,13 +48,13 @@ await repository.remove({company_id: "", id: ""});
|
||||
|
||||
#### I set a column to a type but I get an other type on code. Why for two identical definitions it created fields of different types?
|
||||
|
||||
It depends on what database you use \(mongo or scylladb\) for development. Here is the process for each:
|
||||
It depends on what database you use (MongoDB or PostgreSQL) for development. Here is the process for each:
|
||||
|
||||
Scylla:
|
||||
PostgreSQL:
|
||||
|
||||
- on startup it creates the tables with the requested types, in this case tdrive_boolean => tinyint on scylla side
|
||||
- on save entity it will convert the node type \(boolean\) to the good cql request: "{bool: false}" => "SET bool = 0", it happens in the transformValueToDbString method
|
||||
- on find entity it will convert the database raw value \(a tinyint\) to the nodejs type \(boolean\): 1 => true, 0 => false.
|
||||
- on startup it creates the tables with the requested types, in this case tdrive_boolean => boolean on PostgreSQL side
|
||||
- on save entity it will convert the node type \(boolean\) to the good sql request: "{bool: false}" => "SET bool = false", it happens in the transformValueToDbString method
|
||||
- on find entity it will convert the database raw value \(a boolean\) to the nodejs type \(boolean\)
|
||||
|
||||
Mongo:
|
||||
|
||||
@@ -67,5 +67,5 @@ Mongo:
|
||||
So what could have happened in you case ?
|
||||
|
||||
- \(1\) if you use mongodb and we did not enforce the type before to save to mongo, then maybe you used a string instead of a boolean at some point in time while working and mongo just saved it as it was \(without checking the requested type on entity\)
|
||||
- \(2\) other possibility is that we incorrectly get the information from the database on the typeTransforms.ts file, from cassandra for instance I think we don't convert tinyint back to clean boolean, so you could get 0 and 1 instead of false and true. And maybe instead of 0 and 1 sometime undefined values can convert to ''.
|
||||
- \(2\) other possibility is that we incorrectly get the information from the database on the typeTransforms.ts file, from PostgreSQL for instance I think we don't convert tinyint back to clean boolean, so you could get 0 and 1 instead of false and true. And maybe instead of 0 and 1 sometime undefined values can convert to ''.
|
||||
- To fix all this just enforce the types in typeTransforms.ts for the tdrive_boolean type.
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ This is where you declare the routing you want to use.
|
||||
|
||||
### /services : where the magic happen
|
||||
|
||||
This is where you work for real, calling databases, sending websockets events, using tasks pushers etc.
|
||||
This is where you work for real, calling databases, sending events, using tasks pushers etc.
|
||||
|
||||
### /entities : where we keep the data
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
---
|
||||
description: Tags on TDrive
|
||||
description: Tags on Twake Drive
|
||||
---
|
||||
|
||||
# 📁 Tags
|
||||
|
||||
## description
|
||||
|
||||
**Tags** is everything related to tafs in TDrive after the migration to Node.js.
|
||||
**Tags** is everything related to tags in Twake Drive after the migration to Node.js.
|
||||
|
||||
## Models and APIs
|
||||
|
||||
|
||||
@@ -6,13 +6,8 @@ description: Documents database models
|
||||
|
||||
**DriveFile**
|
||||
|
||||
```javascript
|
||||
{
|
||||
// Primary Key
|
||||
"company_id": uuid;
|
||||
"tag_id": string;
|
||||
|
||||
"name": string;
|
||||
"colour": string;
|
||||
```TypeScript
|
||||
export class DriveFile {
|
||||
tags: string[];
|
||||
}
|
||||
```
|
||||
|
||||
@@ -3,5 +3,4 @@ description: How users and workspaces are managed in backend
|
||||
---
|
||||
|
||||
# 👥 Users and workspaces
|
||||
<!-- TODO[NOT UP TO DATE] -->
|
||||
Document still on notion: [https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b](https://www.notion.so/tdrive/Backend-documentation-e219323593d2401c9887d0e11b2a597b)
|
||||
|
||||
@@ -6,7 +6,7 @@ description: Here is the list of our middlewares and their usages.
|
||||
|
||||
Write an article describing our stack at Twake Drive composed of:
|
||||
|
||||
- In full mode a docker containing: node, react behind nginx, elasticsearch, scylladb, redis, rabbitmq
|
||||
- In full mode a docker containing: node, react behind nginx, Open Search, PostgreSQL, redis, rabbitmq
|
||||
- In simple mode a docker containing: node, react and mongodb for db and search
|
||||
|
||||
### Simple mode
|
||||
@@ -26,8 +26,8 @@ The full mode of Twake Drive messaging app is designed to handle large-scale pro
|
||||
- Node: A JavaScript runtime environment used to develop server-side applications.
|
||||
- React: A JavaScript library used to build user interfaces.
|
||||
- Nginx: A web server used as a reverse proxy to distribute incoming requests to the appropriate backend service.
|
||||
- Elasticsearch: A distributed search and analytics engine used to perform advanced search operations.
|
||||
- Scylladb: A NoSQL database used to store large amounts of structured and unstructured data.
|
||||
- OpenSearch: A distributed search and analytics engine used to perform advanced search operations.
|
||||
- PostgreSQL: An advanced, open-source relational database management system known for its extensibility, SQL compliance, and robust performance.
|
||||
- Redis: An in-memory data structure store used to implement caching, messaging, and pub/sub functionalities.
|
||||
- Rabbitmq: An open-source message broker used to transmit messages between applications.
|
||||
|
||||
|
||||
@@ -8,18 +8,12 @@ description: Want to translate Twake Drive ?
|
||||
|
||||
Twake Drive is built for everyone. That means we support languages that user want. If we do not already support your language, or you find a mistake in the translation, you have a simply way to do that.
|
||||
|
||||
Send us a mail to this address saying that you want to help us on the translation : [sales@tdrive.app](mailto:sales@tdrive.app). After, you'll have to follow the bellow steps.
|
||||
|
||||
## Join weblate server
|
||||
|
||||
At Twake Drive, we use [weblate](https://hosted.weblate.org/), a tool that allow you to translate Twake Drive without working on the code. After you sent an email, we'll invite you to the project. Inside the Twake Drive project you can find [tdrive-web-frontend](https://hosted.weblate.org/projects/tdrive/tdrive-web-frontend/) that contains all translation for the web version.
|
||||
Send us a mail to this address saying that you want to help us on the translation : [software@linagora.com](mailto:software@linagora.com). After, you'll have to follow the bellow steps.
|
||||
|
||||
## Start to translate
|
||||
|
||||
After choosing the language you want to contribute, you can click on categories that need some work \(like `Not translated strings` . Now you can start to translate : you have to fulfill the input You can see `Other languages` tab to give you more context about the string. After, just click on save and it is done !
|
||||
|
||||
.png>)
|
||||
You can add your own language or modify a translation for the existing one [here](https://github.com/linagora/twake-drive/tree/main/tdrive/frontend/public/locales).
|
||||
Just create a PR with your modification and it is done !
|
||||
|
||||
## Thank you!
|
||||
|
||||
Twake Drive is build by and for the community. Your commitment is highly appreciate! In reward, we can offer you a year on our SaaS version. You just have to contact us through this email : [sales@tdrive.app](mailto:sales@tdrive.app)
|
||||
|
||||
@@ -112,7 +112,6 @@ docker-compose.yml
|
||||
/vendor/
|
||||
/app/Ressources/DatabaseEncryption/.HaliteEncryptor.key
|
||||
/app/Ressources/DatabaseEncryption/.Halite.key
|
||||
/backend/websockets_server/false/
|
||||
|
||||
### AWS ###
|
||||
/app/config/aws_config.yml
|
||||
|
||||
@@ -68,19 +68,6 @@ server {
|
||||
proxy_pass ${NODE_HOST};
|
||||
}
|
||||
|
||||
location ~ ^/socket/.* {
|
||||
proxy_pass ${NODE_HOST};
|
||||
# this magic is needed for WebSocket
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_connect_timeout 7d;
|
||||
proxy_send_timeout 7d;
|
||||
proxy_read_timeout 7d;
|
||||
}
|
||||
|
||||
location ~ ^/(ajax|api|administration|upload|bundle|medias).* {
|
||||
# try to serve file directly, fallback to rewrite
|
||||
try_files $uri @rewriteapp;
|
||||
|
||||
Reference in New Issue
Block a user