feat(P23IM2-4): 通知渠道运维态前端(secret保留/替换/清空)

这个提交包含在:
2026-03-13 21:50:04 +08:00
父节点 a8ec86016c
当前提交 e5b4e11f76
共修改 3 个文件,包含 145 行新增和 24 行删除
+22 -3
查看文件
@@ -20,7 +20,17 @@ export type NotificationChannelRouting = {
export type NotificationChannelConfig = {
mode: NotificationChannelMode;
webhookUrl: string | null;
secret: string | null;
timeoutMs: number;
routing: NotificationChannelRouting;
secretConfigured: boolean;
secretMasked: string | null;
};
export type NotificationChannelWriteConfig = {
mode: NotificationChannelMode;
webhookUrl: string | null;
secret?: string | null;
clearSecret?: boolean;
timeoutMs: number;
routing: NotificationChannelRouting;
};
@@ -51,15 +61,24 @@ export type NotificationChannelPayload = {
channelType: "wecom";
name: string;
enabled: boolean;
configJson: NotificationChannelConfig;
configJson: NotificationChannelWriteConfig;
templateJson: NotificationChannelTemplate;
};
export type NotificationChannelUpdatePayload = {
name?: string;
enabled?: boolean;
configJson?: NotificationChannelWriteConfig;
templateJson?: NotificationChannelTemplate;
};
export type NotificationChannelTestResponse = {
channel: NotificationChannel;
testResult: {
ok: boolean;
code: string;
message: string | null;
retryable: boolean | null;
previewMessage: string | null;
response: unknown;
skipped: boolean;
@@ -77,7 +96,7 @@ export async function createNotificationChannel(payload: NotificationChannelPayl
});
}
export async function updateNotificationChannel(id: string, payload: Omit<NotificationChannelPayload, "channelType">) {
export async function updateNotificationChannel(id: string, payload: NotificationChannelUpdatePayload) {
return apiRequestData<{ channel: NotificationChannel }>(`/api/notifications/channels/${id}`, {
method: "PATCH",
body: JSON.stringify(payload),