2024-07-17 15:53:01 +00:00
|
|
|
import {
|
|
|
|
|
Column,
|
|
|
|
|
CreateDateColumn,
|
|
|
|
|
Entity,
|
|
|
|
|
PrimaryGeneratedColumn,
|
|
|
|
|
UpdateDateColumn,
|
|
|
|
|
} from 'typeorm';
|
|
|
|
|
|
|
|
|
|
export enum ServerlessFunctionSyncStatus {
|
|
|
|
|
NOT_READY = 'NOT_READY',
|
|
|
|
|
READY = 'READY',
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-29 11:03:09 +00:00
|
|
|
export enum ServerlessFunctionRuntime {
|
|
|
|
|
NODE18 = 'nodejs18.x',
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-17 15:53:01 +00:00
|
|
|
@Entity('serverlessFunction')
|
|
|
|
|
export class ServerlessFunctionEntity {
|
|
|
|
|
@PrimaryGeneratedColumn('uuid')
|
|
|
|
|
id: string;
|
|
|
|
|
|
|
|
|
|
@Column({ nullable: false })
|
|
|
|
|
name: string;
|
|
|
|
|
|
2024-07-29 11:03:09 +00:00
|
|
|
@Column({ nullable: true })
|
|
|
|
|
description: string;
|
|
|
|
|
|
2024-08-23 10:06:03 +00:00
|
|
|
@Column({ nullable: true })
|
|
|
|
|
latestVersion: string;
|
2024-07-17 15:53:01 +00:00
|
|
|
|
2024-07-29 11:03:09 +00:00
|
|
|
@Column({ nullable: false, default: ServerlessFunctionRuntime.NODE18 })
|
|
|
|
|
runtime: ServerlessFunctionRuntime;
|
|
|
|
|
|
2024-09-02 13:25:20 +00:00
|
|
|
@Column({ nullable: true })
|
|
|
|
|
layerVersion: number;
|
|
|
|
|
|
2024-07-17 15:53:01 +00:00
|
|
|
@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;
|
|
|
|
|
}
|