2026-05-31 01:41:33 +08:00
|
|
|
import { Inject, Provide, Scope, ScopeEnum } from "@midwayjs/core";
|
|
|
|
|
import { IPluginConfigService, PluginConfig } from "@certd/pipeline";
|
|
|
|
|
import { PluginConfigService } from "./plugin-config-service.js";
|
2024-10-14 03:17:10 +08:00
|
|
|
|
|
|
|
|
@Provide()
|
2024-12-23 00:24:31 +08:00
|
|
|
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
2024-10-14 03:17:10 +08:00
|
|
|
export class PluginConfigGetter implements IPluginConfigService {
|
|
|
|
|
@Inject()
|
|
|
|
|
pluginConfigService: PluginConfigService;
|
|
|
|
|
|
|
|
|
|
async getPluginConfig(pluginName: string): Promise<PluginConfig> {
|
|
|
|
|
const res = await this.pluginConfigService.getPluginConfig({
|
|
|
|
|
name: pluginName,
|
2026-05-31 01:41:33 +08:00
|
|
|
type: "builtIn",
|
2024-10-14 03:17:10 +08:00
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
name: res.name,
|
|
|
|
|
disabled: res.disabled,
|
|
|
|
|
sysSetting: res.sysSetting,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|