feat: 【破坏性更新】插件改为metadata加载模式,plugin-cert、plugin-lib包部分代码转移到certd-server中,影响自定义插件,需要修改相关import引用

ssh、aliyun、tencent、qiniu、oss等 access和client需要转移import
This commit is contained in:
xiaojunnuo
2025-12-31 17:01:37 +08:00
parent 9c26598831
commit a3fb24993d
312 changed files with 14321 additions and 597 deletions

View File

@@ -11,6 +11,9 @@ export const ACCESS_INPUT_KEY = "pipeline:access:input";
export function IsAccess(define: AccessDefine): ClassDecorator {
return (target: any) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target);
const inputs: any = {};
@@ -35,6 +38,9 @@ export function IsAccess(define: AccessDefine): ClassDecorator {
export function AccessInput(input?: AccessInputDefine): PropertyDecorator {
return (target, propertyKey) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target, propertyKey);
// const _type = Reflect.getMetadata("design:type", target, propertyKey);
Reflect.defineMetadata(ACCESS_INPUT_KEY, input, target, propertyKey);

View File

@@ -11,6 +11,9 @@ export const NOTIFICATION_INPUT_KEY = "pipeline:notification:input";
export function IsNotification(define: NotificationDefine): ClassDecorator {
return (target: any) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target);
const inputs: any = {};
@@ -35,6 +38,9 @@ export function IsNotification(define: NotificationDefine): ClassDecorator {
export function NotificationInput(input?: NotificationInputDefine): PropertyDecorator {
return (target, propertyKey) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target, propertyKey);
// const _type = Reflect.getMetadata("design:type", target, propertyKey);
Reflect.defineMetadata(NOTIFICATION_INPUT_KEY, input, target, propertyKey);

View File

@@ -8,6 +8,9 @@ export const PLUGIN_CLASS_KEY = "pipeline:plugin";
export function IsTaskPlugin(define: PluginDefine): ClassDecorator {
return (target: any) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target);
const inputs: any = {};
@@ -69,6 +72,9 @@ export const PLUGIN_INPUT_KEY = "pipeline:plugin:input";
export function TaskInput(input?: TaskInputDefine): PropertyDecorator {
return (target, propertyKey) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target, propertyKey);
Reflect.defineMetadata(PLUGIN_INPUT_KEY, input, target, propertyKey);
};
@@ -78,6 +84,9 @@ export function TaskInput(input?: TaskInputDefine): PropertyDecorator {
export const PLUGIN_OUTPUT_KEY = "pipeline:plugin:output";
export function TaskOutput(output?: TaskOutputDefine): PropertyDecorator {
return (target, propertyKey) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target, propertyKey);
Reflect.defineMetadata(PLUGIN_OUTPUT_KEY, output, target, propertyKey);
};
@@ -86,6 +95,9 @@ export function TaskOutput(output?: TaskOutputDefine): PropertyDecorator {
export const PLUGIN_DOWNLOAD_KEY = "pipeline:plugin:download";
export function TaskDownload(output?: TaskOutputDefine): PropertyDecorator {
return (target, propertyKey) => {
if (process.env.certd_plugin_loadmode === "metadata") {
return;
}
target = Decorator.target(target, propertyKey);
Reflect.defineMetadata(PLUGIN_DOWNLOAD_KEY, output, target, propertyKey);
};

View File

@@ -1,4 +1,4 @@
import { IAccess } from "../access";
import { IAccess } from "../access/index.js";
export type CnameProvider = {
id: any;