- improvements on serverless function behavior (autosave performances, deploy on execution only) - add versioning to serverless functions - add a publish endpoint to create a new version of a serverless function - add deploy and reset to lastVersion button in the settings section: <img width="736" alt="image" src="https://github.com/user-attachments/assets/2001f8d2-07a4-4f79-84dd-ec74b6f301d3">
57 lines
1.2 KiB
TypeScript
57 lines
1.2 KiB
TypeScript
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
PrimaryGeneratedColumn,
|
|
Unique,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
export enum ServerlessFunctionSyncStatus {
|
|
NOT_READY = 'NOT_READY',
|
|
READY = 'READY',
|
|
}
|
|
|
|
export enum ServerlessFunctionRuntime {
|
|
NODE18 = 'nodejs18.x',
|
|
}
|
|
|
|
@Entity('serverlessFunction')
|
|
@Unique('IndexOnNameAndWorkspaceIdUnique', ['name', 'workspaceId'])
|
|
export class ServerlessFunctionEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ nullable: false })
|
|
name: string;
|
|
|
|
@Column({ nullable: true })
|
|
description: string;
|
|
|
|
@Column({ nullable: true })
|
|
latestVersion: string;
|
|
|
|
@Column({ nullable: false })
|
|
sourceCodeHash: string;
|
|
|
|
@Column({ nullable: false, default: ServerlessFunctionRuntime.NODE18 })
|
|
runtime: ServerlessFunctionRuntime;
|
|
|
|
@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;
|
|
}
|