14066 extensibility add coretriggerroute table (#14241)

This Pr 
- adds a `route` table to the core schema
- adds a controller to trigger route

For now, we need to add a `/s/<workspace_id>` prefix to all routes

We plan to create a custom domain table in order to let the users create
subdomains for their workspace, and so to link their routes to a
subdomain. Thank to that, we will be able to identify workspace_id from
domain name, and the prefix could be `/s`. If we create a native
dedicated subdomain for routes for each workspaces, the prefix could be
completely removed!

Here the follow up ticket to do that ->
https://github.com/twentyhq/twenty/issues/14240
This commit is contained in:
martmull
2025-09-02 11:24:59 +02:00
committed by GitHub
parent bfad5b0477
commit a722d97724
12 changed files with 367 additions and 8 deletions
@@ -13,6 +13,7 @@ import {
import { InputSchema } from 'src/modules/workflow/workflow-builder/workflow-schema/types/input-schema.type';
import { CronTrigger } from 'src/engine/metadata-modules/trigger/entities/cron-trigger.entity';
import { DatabaseEventTrigger } from 'src/engine/metadata-modules/trigger/entities/database-event-trigger.entity';
import { Route } from 'src/engine/metadata-modules/route/route.entity';
const DEFAULT_SERVERLESS_TIMEOUT_SECONDS = 300; // 5 minutes
@@ -73,6 +74,11 @@ export class ServerlessFunctionEntity {
)
databaseEventTriggers: DatabaseEventTrigger[];
@OneToMany(() => Route, (route) => route.serverlessFunction, {
cascade: true,
})
routes: Route[];
@CreateDateColumn({ type: 'timestamptz' })
createdAt: Date;