mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
924 B
TypeScript
57 lines
924 B
TypeScript
import {
|
|
getModelForClass,
|
|
prop,
|
|
DocumentType,
|
|
Ref,
|
|
ReturnModelType,
|
|
modelOptions,
|
|
} from '@typegoose/typegoose';
|
|
import { Base, TimeStamps } from '@typegoose/typegoose/lib/defaultClasses';
|
|
import type { Types } from 'mongoose';
|
|
import { User } from '../user/user';
|
|
|
|
export class PluginManifest extends TimeStamps implements Base {
|
|
_id: Types.ObjectId;
|
|
id: string;
|
|
|
|
@prop()
|
|
label: string;
|
|
|
|
@prop({
|
|
unique: true,
|
|
})
|
|
name: string;
|
|
|
|
/**
|
|
* 插件入口地址
|
|
*/
|
|
@prop()
|
|
url: string;
|
|
|
|
@prop()
|
|
icon?: string;
|
|
|
|
@prop()
|
|
version: string;
|
|
|
|
@prop()
|
|
author: string;
|
|
|
|
@prop()
|
|
description: string;
|
|
|
|
@prop()
|
|
requireRestart: string;
|
|
|
|
@prop({ ref: () => User })
|
|
uploader?: Ref<User>;
|
|
}
|
|
|
|
export type PluginManifestDocument = DocumentType<PluginManifest>;
|
|
|
|
const model = getModelForClass(PluginManifest);
|
|
|
|
export type PluginManifestModel = typeof model;
|
|
|
|
export default model;
|