- apps/api: FastAPI backend with Dockerfile - apps/web: Next.js frontend with Dockerfile - apps/sensor: Signal collection agent - packages: shared packages Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
1010 B
TypeScript
60 lines
1010 B
TypeScript
/**
|
|
* OUTPUT 積木 - 通知頻道介面
|
|
* 用途: Telegram, Slack, LINE, Email, Discord
|
|
*/
|
|
|
|
import type { LeWOOOgoPlugin } from './plugin'
|
|
|
|
/**
|
|
* 通知訊息
|
|
*/
|
|
export interface NotificationMessage {
|
|
title?: string
|
|
body: string
|
|
priority?: 'low' | 'normal' | 'high' | 'urgent'
|
|
metadata?: Record<string, unknown>
|
|
}
|
|
|
|
/**
|
|
* 通知模板
|
|
*/
|
|
export interface NotificationTemplate {
|
|
id: string
|
|
name: string
|
|
description?: string
|
|
variables: string[]
|
|
preview?: string
|
|
}
|
|
|
|
/**
|
|
* 發送結果
|
|
*/
|
|
export interface SendResult {
|
|
success: boolean
|
|
messageId?: string
|
|
error?: string
|
|
timestamp: Date
|
|
}
|
|
|
|
/**
|
|
* OUTPUT 通知頻道 Plugin
|
|
*/
|
|
export interface NotificationChannel extends LeWOOOgoPlugin {
|
|
category: 'OUTPUT'
|
|
|
|
/**
|
|
* 發送通知
|
|
*/
|
|
send(message: NotificationMessage): Promise<SendResult>
|
|
|
|
/**
|
|
* 批量發送
|
|
*/
|
|
sendBatch?(messages: NotificationMessage[]): Promise<SendResult[]>
|
|
|
|
/**
|
|
* 取得可用模板
|
|
*/
|
|
getTemplates(): NotificationTemplate[]
|
|
}
|