mirror of
https://github.com/langgenius/dify.git
synced 2026-03-16 04:17:43 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
37 lines
734 B
TypeScript
37 lines
734 B
TypeScript
import { type } from '@orpc/contract'
|
|
import { base } from '../base'
|
|
|
|
export type ConsoleNotification = {
|
|
body: string
|
|
frequency: 'once' | 'always'
|
|
lang: string
|
|
notification_id: string
|
|
subtitle: string
|
|
title: string
|
|
title_pic_url?: string
|
|
}
|
|
|
|
export type ConsoleNotificationResponse = {
|
|
notifications: ConsoleNotification[]
|
|
should_show: boolean
|
|
}
|
|
|
|
export const notificationContract = base
|
|
.route({
|
|
path: '/notification',
|
|
method: 'GET',
|
|
})
|
|
.output(type<ConsoleNotificationResponse>())
|
|
|
|
export const notificationDismissContract = base
|
|
.route({
|
|
path: '/notification/dismiss',
|
|
method: 'POST',
|
|
})
|
|
.input(type<{
|
|
body: {
|
|
notification_id: string
|
|
}
|
|
}>())
|
|
.output(type<unknown>())
|