Spaces:
Runtime error
Runtime error
| import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | |
| import { IsArray, IsObject, IsString, IsUrl } from 'class-validator'; | |
| import type { PluginConfigSchema, PluginI18n } from '../../../core/plugins'; | |
| import { PluginType, PluginStatus } from '../../../core/plugins'; | |
| export class PluginDto { | |
| ({ description: 'Plugin ID' }) | |
| id!: string; | |
| ({ description: 'Plugin name' }) | |
| name!: string; | |
| ({ description: 'Plugin version' }) | |
| version!: string; | |
| ({ enum: PluginType, description: 'Plugin type' }) | |
| type!: PluginType; | |
| ({ description: 'Plugin description' }) | |
| description?: string; | |
| ({ description: 'Plugin author' }) | |
| author?: string; | |
| ({ enum: PluginStatus, description: 'Plugin status' }) | |
| status!: PluginStatus; | |
| ({ description: 'Plugin configuration' }) | |
| config!: Record<string, unknown>; | |
| ({ description: 'Whether this is a built-in plugin' }) | |
| builtIn!: boolean; | |
| ({ description: 'Features provided by this plugin' }) | |
| provides!: string[]; | |
| ({ description: 'Whether this plugin can host provisioned ingress instances' }) | |
| ingressCapable!: boolean; | |
| ({ description: 'Whether the plugin is scoped to specific sessions (false = global)' }) | |
| sessionScoped!: boolean; | |
| ({ description: "Sessions this plugin is activated for; ['*'] = all numbers" }) | |
| activeSessions!: string[]; | |
| ({ description: 'Configuration schema' }) | |
| configSchema?: PluginConfigSchema; | |
| ({ description: 'Sandboxed-iframe config editor (entry HTML + optional height)' }) | |
| configUi?: { entry: string; height?: number }; | |
| ({ description: 'Localized dashboard text (name/description/config titles) per locale code' }) | |
| i18n?: PluginI18n; | |
| ({ description: 'Per-session config overrides, keyed by sessionId (secrets redacted)' }) | |
| sessionConfig?: Record<string, Record<string, unknown>>; | |
| ({ description: 'When the plugin was loaded' }) | |
| loadedAt?: string; | |
| ({ description: 'When the plugin was enabled' }) | |
| enabledAt?: string; | |
| ({ description: 'Error message if plugin is in error state' }) | |
| error?: string; | |
| } | |
| export class PluginConfigDto { | |
| ({ description: 'Plugin configuration object' }) | |
| () | |
| config!: Record<string, unknown>; | |
| } | |
| export class PluginSessionsDto { | |
| ({ | |
| description: "Sessions to activate the plugin for; ['*'] = all numbers, [] = none", | |
| example: ['*'], | |
| type: [String], | |
| }) | |
| () | |
| ({ each: true }) | |
| sessions!: string[]; | |
| } | |
| export class InstallFromUrlDto { | |
| ({ description: 'HTTP(S) URL of the plugin .zip to download and install' }) | |
| () | |
| ({ protocols: ['http', 'https'], require_protocol: true }) | |
| url!: string; | |
| } | |