import { readObj } from '@rsdk/common.node'; import { DeclareProperty, InjectProperty } from '../../metadata'; import { FsPathParser } from '../../parsers'; import type { SourceType } from '../../types'; import { ConfigSource } from '../base'; import { Source } from '../config-source.decorator'; @Source('static') @DeclareProperty(`CONFIG_PATH`, new FsPathParser('file'), { description: 'Path to some configuration file', }) export class StaticFileSource extends ConfigSource { constructor(@InjectProperty('CONFIG_PATH') private readonly path: string) { super(); } override type(): SourceType { return 'static'; } override name(): string { return `Static conf file: ${this.path}`; } override loadRaw(): Promise { return readObj(this.path); } }