Files
certd/packages/ui/certd-server/src/modules/pipeline/service/builtin-plugin-service.ts
T

25 lines
591 B
TypeScript
Raw Normal View History

2024-07-15 00:30:33 +08:00
import { Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { pluginGroups, pluginRegistry } from '@certd/pipeline';
2024-12-03 00:35:34 +08:00
import { cloneDeep } from 'lodash-es';
2024-10-13 01:27:08 +08:00
2023-01-29 13:44:19 +08:00
@Provide()
@Scope(ScopeEnum.Singleton)
2024-10-13 01:27:08 +08:00
export class BuiltInPluginService {
2023-01-29 13:44:19 +08:00
getList() {
const collection = pluginRegistry.storage;
const list = [];
for (const key in collection) {
const Plugin = collection[key];
2024-09-30 12:25:44 +08:00
if (Plugin?.define?.deprecated) {
2024-09-29 14:57:20 +08:00
continue;
}
2023-01-29 13:44:19 +08:00
list.push({ ...Plugin.define, key });
}
return list;
}
getGroups() {
2024-12-03 00:35:34 +08:00
return cloneDeep(pluginGroups);
}
2023-01-29 13:44:19 +08:00
}