2024-10-14 03:17:10 +08:00
|
|
|
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
|
|
|
|
import { IPluginConfigService, PluginConfig } from '@certd/pipeline';
|
|
|
|
|
import { PluginConfigService } from './plugin-config-service.js';
|
|
|
|
|
|
|
|
|
|
@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,
|
|
|
|
|
type: 'builtIn',
|
|
|
|
|
});
|
|
|
|
|
return {
|
|
|
|
|
name: res.name,
|
|
|
|
|
disabled: res.disabled,
|
|
|
|
|
sysSetting: res.sysSetting,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|