mirror of
https://github.com/lingble/twenty.git
synced 2025-11-03 06:07:56 +00:00
Closes #6181 ## Testing - download Altair graphql dev tool https://altairgraphql.dev/#download - create a file locally `test.ts` containing: ``` export const handler = async (event: object, context: object) => { return { test: 'toto', data: event['data'] }; } ``` - play those requests in Altair: mutation UpsertFunction($file: Upload!) { upsertFunction(name: "toto", file: $file) } mutation ExecFunction { executeFunction(name:"toto", payload: {data: "titi"}) } - it will run the local driver, add those env variable to test with lambda driver ``` CUSTOM_CODE_ENGINE_DRIVER_TYPE=lambda LAMBDA_REGION=eu-west-2 LAMBDA_ROLE=<ASK_ME> ```
44 lines
903 B
TypeScript
44 lines
903 B
TypeScript
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Unique,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
export enum ServerlessFunctionSyncStatus {
|
|
NOT_READY = 'NOT_READY',
|
|
READY = 'READY',
|
|
}
|
|
|
|
@Entity('serverlessFunction')
|
|
@Unique('IndexOnNameAndWorkspaceIdUnique', ['name', 'workspaceId'])
|
|
export class ServerlessFunctionEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ nullable: false })
|
|
name: string;
|
|
|
|
@Column({ nullable: false })
|
|
sourceCodeHash: string;
|
|
|
|
@Column({
|
|
nullable: false,
|
|
default: ServerlessFunctionSyncStatus.NOT_READY,
|
|
type: 'enum',
|
|
enum: ServerlessFunctionSyncStatus,
|
|
})
|
|
syncStatus: ServerlessFunctionSyncStatus;
|
|
|
|
@Column({ nullable: false, type: 'uuid' })
|
|
workspaceId: string;
|
|
|
|
@CreateDateColumn({ type: 'timestamptz' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ type: 'timestamptz' })
|
|
updatedAt: Date;
|
|
}
|