mirror of
https://github.com/langgenius/dify.git
synced 2026-06-16 22:11:09 +08:00
17 lines
569 B
TypeScript
17 lines
569 B
TypeScript
import type { ConfigFile } from '@/config/schema'
|
|
import type { YamlStore } from '@/store/store'
|
|
import { loadConfig } from '@/config/config-loader'
|
|
import { getKey } from '@/config/keys'
|
|
import { emptyConfig } from '@/config/schema'
|
|
|
|
export type RunConfigGetOptions = {
|
|
readonly key: string
|
|
readonly store: YamlStore
|
|
}
|
|
|
|
export async function runConfigGet(opts: RunConfigGetOptions): Promise<string> {
|
|
const loaded = await loadConfig(opts.store)
|
|
const config: ConfigFile = loaded.found ? loaded.config : emptyConfig()
|
|
return `${getKey(config, opts.key)}\n`
|
|
}
|