Spaces:
Build error
Build error
twenty / packages /twenty-server /src /engine /metadata-modules /logic-function /logic-function.entity.ts
| import { | |
| Check, | |
| Column, | |
| CreateDateColumn, | |
| DeleteDateColumn, | |
| Entity, | |
| Index, | |
| PrimaryGeneratedColumn, | |
| UpdateDateColumn, | |
| } from 'typeorm'; | |
| import { | |
| CronTriggerSettings, | |
| DatabaseEventTriggerSettings, | |
| HttpRouteTriggerSettings, | |
| ServerRouteTriggerSettings, | |
| ToolTriggerSettings, | |
| WorkflowActionTriggerSettings, | |
| } from 'twenty-shared/application'; | |
| import { SyncableEntity } from 'src/engine/workspace-manager/types/syncable-entity.interface'; | |
| import { type JsonbProperty } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/jsonb-property.type'; | |
| const DEFAULT_LOGIC_FUNCTION_TIMEOUT_SECONDS = 300; // 5 minutes | |
| export enum LogicFunctionRuntime { | |
| NODE18 = 'nodejs18.x', | |
| NODE22 = 'nodejs22.x', | |
| } | |
| export enum LogicFunctionExecutionMode { | |
| LIVE = 'LIVE', | |
| PREBUILT = 'PREBUILT', | |
| } | |
| ('logicFunction') | |
| ('IDX_LOGIC_FUNCTION_ID_DELETED_AT', ['id', 'deletedAt']) | |
| export class LogicFunctionEntity | |
| extends SyncableEntity | |
| implements Required<LogicFunctionEntity> | |
| { | |
| ('uuid') | |
| id: string; | |
| ({ nullable: false }) | |
| name: string; | |
| ({ nullable: false }) | |
| sourceHandlerPath: string; | |
| ({ nullable: false }) | |
| builtHandlerPath: string; | |
| ({ nullable: false }) | |
| handlerName: string; | |
| ({ nullable: true, type: 'varchar' }) | |
| description: string | null; | |
| ({ nullable: false, default: LogicFunctionRuntime.NODE22 }) | |
| runtime: LogicFunctionRuntime; | |
| ({ nullable: false, default: DEFAULT_LOGIC_FUNCTION_TIMEOUT_SECONDS }) | |
| (`"timeoutSeconds" >= 1 AND "timeoutSeconds" <= 900`) | |
| timeoutSeconds: number; | |
| ({ nullable: true, type: 'text' }) | |
| checksum: string | null; | |
| ({ nullable: false, type: 'boolean', default: true }) | |
| isBuildUpToDate: boolean; | |
| ({ | |
| type: 'enum', | |
| enum: LogicFunctionExecutionMode, | |
| default: LogicFunctionExecutionMode.LIVE, | |
| nullable: false, | |
| }) | |
| executionMode: LogicFunctionExecutionMode; | |
| ({ nullable: true, type: 'jsonb' }) | |
| cronTriggerSettings: JsonbProperty<CronTriggerSettings> | null; | |
| ({ nullable: true, type: 'jsonb' }) | |
| databaseEventTriggerSettings: JsonbProperty<DatabaseEventTriggerSettings> | null; | |
| ({ nullable: true, type: 'jsonb' }) | |
| httpRouteTriggerSettings: JsonbProperty<HttpRouteTriggerSettings> | null; | |
| ({ nullable: true, type: 'jsonb' }) | |
| serverRouteTriggerSettings: JsonbProperty<ServerRouteTriggerSettings> | null; | |
| ({ nullable: true, type: 'jsonb' }) | |
| toolTriggerSettings: JsonbProperty<ToolTriggerSettings> | null; | |
| ({ nullable: true, type: 'jsonb' }) | |
| workflowActionTriggerSettings: JsonbProperty<WorkflowActionTriggerSettings> | null; | |
| ({ type: 'timestamptz' }) | |
| createdAt: Date; | |
| ({ type: 'timestamptz' }) | |
| updatedAt: Date; | |
| ({ type: 'timestamptz' }) | |
| deletedAt: Date | null; | |
| } | |