This commit is contained in:
2024-09-20 22:04:27 +08:00
parent e3991379df
commit a8f80abc88
15 changed files with 892 additions and 66 deletions

View File

@@ -7,16 +7,14 @@ export interface ContainerData {
showChild?: boolean;
shadowRoot?: boolean;
}
export type Container = {
id?: string;
title?: string;
export type ContainerPublish = {
rid?: string; // resource id
name?: string;
description?: string;
type?: string;
code?: string;
source?: string;
sourceType?: string;
data?: ContainerData;
version?: string;
};
export type Container = Partial<InstanceType<typeof ContainerModel>>;
export class ContainerModel extends Model {
declare id: string;
declare title: string;
@@ -26,6 +24,12 @@ export class ContainerModel extends Model {
declare source: string;
declare sourceType: string;
declare data: ContainerData;
declare publish: ContainerPublish;
declare uid: string;
// timestamps
public readonly createdAt!: Date;
public readonly updatedAt!: Date;
}
ContainerModel.init(
{
@@ -63,6 +67,11 @@ ContainerModel.init(
type: DataTypes.JSON,
defaultValue: {},
},
publish: {
type: DataTypes.JSON,
defaultValue: {},
},
uid: {
type: DataTypes.UUID,
allowNull: true,