feat: deprecate old notification module and introduce new notifier module
This commit is contained in:
@@ -201,9 +201,9 @@ export const applyCAProvidersMap: Map<ApplyCAProvider["type"] | string, ApplyCAP
|
||||
|
||||
// #region ApplyDNSProvider
|
||||
/*
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
export const APPLY_DNS_PROVIDERS = Object.freeze({
|
||||
ACMEHTTPREQ: `${ACCESS_PROVIDERS.ACMEHTTPREQ}`,
|
||||
ALIYUN: `${ACCESS_PROVIDERS.ALIYUN}`, // 兼容旧值,等同于 `ALIYUN_DNS`
|
||||
@@ -255,9 +255,9 @@ export type ApplyDNSProvider = {
|
||||
|
||||
export const applyDNSProvidersMap: Map<ApplyDNSProvider["type"] | string, ApplyDNSProvider> = new Map(
|
||||
/*
|
||||
注意:此处的顺序决定显示在前端的顺序。
|
||||
NOTICE: The following order determines the order displayed at the frontend.
|
||||
*/
|
||||
注意:此处的顺序决定显示在前端的顺序。
|
||||
NOTICE: The following order determines the order displayed at the frontend.
|
||||
*/
|
||||
[
|
||||
[APPLY_DNS_PROVIDERS.ALIYUN_DNS, "provider.aliyun.dns"],
|
||||
[APPLY_DNS_PROVIDERS.TENCENTCLOUD_DNS, "provider.tencentcloud.dns"],
|
||||
@@ -302,9 +302,9 @@ export const applyDNSProvidersMap: Map<ApplyDNSProvider["type"] | string, ApplyD
|
||||
|
||||
// #region DeployProvider
|
||||
/*
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
export const DEPLOY_PROVIDERS = Object.freeze({
|
||||
["1PANEL_CONSOLE"]: `${ACCESS_PROVIDERS["1PANEL"]}-console`,
|
||||
["1PANEL_SITE"]: `${ACCESS_PROVIDERS["1PANEL"]}-site`,
|
||||
@@ -500,3 +500,38 @@ export const deployProvidersMap: Map<DeployProvider["type"] | string, DeployProv
|
||||
])
|
||||
);
|
||||
// #endregion
|
||||
|
||||
// #region NotifyProvider
|
||||
/*
|
||||
注意:如果追加新的常量值,请保持以 ASCII 排序。
|
||||
NOTICE: If you add new constant, please keep ASCII order.
|
||||
*/
|
||||
export const NOTIFY_PROVIDERS = Object.freeze({
|
||||
WEBHOOK: `${ACCESS_PROVIDERS.WEBHOOK}`,
|
||||
} as const);
|
||||
|
||||
export type NotifyProviderType = (typeof APPLY_CA_PROVIDERS)[keyof typeof APPLY_CA_PROVIDERS];
|
||||
|
||||
export type NotifyProvider = {
|
||||
type: NotifyProviderType;
|
||||
name: string;
|
||||
icon: string;
|
||||
provider: AccessProviderType;
|
||||
};
|
||||
|
||||
export const notifyProvidersMap: Map<NotifyProvider["type"] | string, NotifyProvider> = new Map(
|
||||
/*
|
||||
注意:此处的顺序决定显示在前端的顺序。
|
||||
NOTICE: The following order determines the order displayed at the frontend.
|
||||
*/
|
||||
[[NOTIFY_PROVIDERS.WEBHOOK]].map(([type]) => [
|
||||
type,
|
||||
{
|
||||
type: type as ApplyCAProviderType,
|
||||
name: accessProvidersMap.get(type.split("-")[0])!.name,
|
||||
icon: accessProvidersMap.get(type.split("-")[0])!.icon,
|
||||
provider: type.split("-")[0] as AccessProviderType,
|
||||
},
|
||||
])
|
||||
);
|
||||
// #endregion
|
||||
|
||||
@@ -3,6 +3,9 @@ import { type ApplyCAProviderType } from "./provider";
|
||||
export const SETTINGS_NAMES = Object.freeze({
|
||||
EMAILS: "emails",
|
||||
NOTIFY_TEMPLATES: "notifyTemplates",
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
NOTIFY_CHANNELS: "notifyChannels",
|
||||
SSL_PROVIDER: "sslProvider",
|
||||
PERSISTENCE: "persistence",
|
||||
@@ -38,6 +41,9 @@ export const defaultNotifyTemplate: NotifyTemplate = {
|
||||
// #endregion
|
||||
|
||||
// #region Settings: NotifyChannels
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export const NOTIFY_CHANNELS = Object.freeze({
|
||||
BARK: "bark",
|
||||
DINGTALK: "dingtalk",
|
||||
@@ -53,8 +59,14 @@ export const NOTIFY_CHANNELS = Object.freeze({
|
||||
WECOM: "wecom",
|
||||
} as const);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export type NotifyChannels = (typeof NOTIFY_CHANNELS)[keyof typeof NOTIFY_CHANNELS];
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export type NotifyChannelsSettingsContent = {
|
||||
/*
|
||||
注意:如果追加新的类型,请保持以 ASCII 排序。
|
||||
@@ -116,7 +128,7 @@ export type MattermostNotifyChannelConfig = {
|
||||
username: string;
|
||||
password: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export type PushoverNotifyChannelConfig = {
|
||||
token: string;
|
||||
@@ -155,6 +167,9 @@ export type NotifyChannel = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
export const notifyChannelsMap: Map<NotifyChannel["type"], NotifyChannel> = new Map(
|
||||
[
|
||||
[NOTIFY_CHANNELS.EMAIL, "common.notifier.email"],
|
||||
|
||||
@@ -154,9 +154,15 @@ export type WorkflowNodeConfigForDeploy = {
|
||||
};
|
||||
|
||||
export type WorkflowNodeConfigForNotify = {
|
||||
channel: string;
|
||||
subject: string;
|
||||
message: string;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
channel?: string;
|
||||
provider: string;
|
||||
providerAccessId: string;
|
||||
providerConfig?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type WorkflowNodeConfigForBranch = never;
|
||||
|
||||
Reference in New Issue
Block a user