Spaces:
Sleeping
Sleeping
File size: 1,628 Bytes
525d39f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsObject } from 'class-validator';
import type { PluginConfigSchema } from '../../../core/plugins';
import { PluginType, PluginStatus } from '../../../core/plugins';
export class PluginDto {
@ApiProperty({ description: 'Plugin ID' })
id!: string;
@ApiProperty({ description: 'Plugin name' })
name!: string;
@ApiProperty({ description: 'Plugin version' })
version!: string;
@ApiProperty({ enum: PluginType, description: 'Plugin type' })
type!: PluginType;
@ApiPropertyOptional({ description: 'Plugin description' })
description?: string;
@ApiPropertyOptional({ description: 'Plugin author' })
author?: string;
@ApiProperty({ enum: PluginStatus, description: 'Plugin status' })
status!: PluginStatus;
@ApiProperty({ description: 'Plugin configuration' })
config!: Record<string, unknown>;
@ApiProperty({ description: 'Whether this is a built-in plugin' })
builtIn!: boolean;
@ApiProperty({ description: 'Features provided by this plugin' })
provides!: string[];
@ApiPropertyOptional({ description: 'Configuration schema' })
configSchema?: PluginConfigSchema;
@ApiPropertyOptional({ description: 'When the plugin was loaded' })
loadedAt?: string;
@ApiPropertyOptional({ description: 'When the plugin was enabled' })
enabledAt?: string;
@ApiPropertyOptional({ description: 'Error message if plugin is in error state' })
error?: string;
}
export class PluginConfigDto {
@ApiProperty({ description: 'Plugin configuration object' })
@IsObject()
config!: Record<string, unknown>;
}
|