chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
+54
@@ -0,0 +1,54 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
import {
|
||||
zGetNotificationQuery,
|
||||
zGetNotificationResponse,
|
||||
zPostNotificationDismissBody,
|
||||
zPostNotificationDismissResponse,
|
||||
} from './zod.gen.ts'
|
||||
|
||||
/**
|
||||
* Mark a notification as dismissed for the current user.
|
||||
*/
|
||||
export const post = oc
|
||||
.route({
|
||||
description: 'Mark a notification as dismissed for the current user.',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postNotificationDismiss',
|
||||
path: '/notification/dismiss',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostNotificationDismissBody }))
|
||||
.output(zPostNotificationDismissResponse)
|
||||
|
||||
export const dismiss = {
|
||||
post,
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the active in-product notification for the current user in the requested language (defaults to English when omitted). Unavailable translations fall back to English, then the first available content. The notification is NOT marked as seen here; call POST /notification/dismiss when the user explicitly closes the modal.
|
||||
*/
|
||||
export const get = oc
|
||||
.route({
|
||||
description:
|
||||
'Return the active in-product notification for the current user in the requested language (defaults to English when omitted). Unavailable translations fall back to English, then the first available content. The notification is NOT marked as seen here; call POST /notification/dismiss when the user explicitly closes the modal.',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getNotification',
|
||||
path: '/notification',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetNotificationQuery.optional() }).optional())
|
||||
.output(zGetNotificationResponse)
|
||||
|
||||
export const notification = {
|
||||
get,
|
||||
dismiss,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
notification,
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type NotificationResponse = {
|
||||
notifications: Array<NotificationItemResponse>
|
||||
should_show: boolean
|
||||
}
|
||||
|
||||
export type ErrorResponse = {
|
||||
code: string
|
||||
details?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
message: string
|
||||
params?: string
|
||||
status: number
|
||||
}
|
||||
|
||||
export type DismissNotificationPayload = {
|
||||
notification_id: string
|
||||
}
|
||||
|
||||
export type SimpleResultResponse = {
|
||||
result: string
|
||||
}
|
||||
|
||||
export type NotificationItemResponse = {
|
||||
body: string
|
||||
frequency: 'every_page_load' | 'once'
|
||||
lang: string
|
||||
notification_id: string
|
||||
subtitle: string
|
||||
title: string
|
||||
title_pic_url: string
|
||||
}
|
||||
|
||||
export type GetNotificationData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
language?: string
|
||||
}
|
||||
url: '/notification'
|
||||
}
|
||||
|
||||
export type GetNotificationErrors = {
|
||||
401: ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type GetNotificationError = GetNotificationErrors[keyof GetNotificationErrors]
|
||||
|
||||
export type GetNotificationResponses = {
|
||||
200: NotificationResponse
|
||||
}
|
||||
|
||||
export type GetNotificationResponse = GetNotificationResponses[keyof GetNotificationResponses]
|
||||
|
||||
export type PostNotificationDismissData = {
|
||||
body: DismissNotificationPayload
|
||||
path?: never
|
||||
query?: never
|
||||
url: '/notification/dismiss'
|
||||
}
|
||||
|
||||
export type PostNotificationDismissErrors = {
|
||||
401: ErrorResponse
|
||||
default: ErrorResponse
|
||||
}
|
||||
|
||||
export type PostNotificationDismissError =
|
||||
PostNotificationDismissErrors[keyof PostNotificationDismissErrors]
|
||||
|
||||
export type PostNotificationDismissResponses = {
|
||||
200: SimpleResultResponse
|
||||
}
|
||||
|
||||
export type PostNotificationDismissResponse =
|
||||
PostNotificationDismissResponses[keyof PostNotificationDismissResponses]
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* ErrorResponse
|
||||
*
|
||||
* Documented non-2xx body emitted by ``register_external_error_handlers``.
|
||||
*
|
||||
* ``params`` and ``details`` appear only on the errors that set them. The schema
|
||||
* stays open because ``HTTPException.data`` may carry extra keys.
|
||||
*/
|
||||
export const zErrorResponse = z.object({
|
||||
code: z.string(),
|
||||
details: z.record(z.string(), z.unknown()).optional(),
|
||||
message: z.string(),
|
||||
params: z.string().optional(),
|
||||
status: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* DismissNotificationPayload
|
||||
*/
|
||||
export const zDismissNotificationPayload = z.object({
|
||||
notification_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* SimpleResultResponse
|
||||
*/
|
||||
export const zSimpleResultResponse = z.object({
|
||||
result: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* NotificationItemResponse
|
||||
*/
|
||||
export const zNotificationItemResponse = z.object({
|
||||
body: z.string(),
|
||||
frequency: z.enum(['every_page_load', 'once']),
|
||||
lang: z.string(),
|
||||
notification_id: z.string(),
|
||||
subtitle: z.string(),
|
||||
title: z.string(),
|
||||
title_pic_url: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* NotificationResponse
|
||||
*/
|
||||
export const zNotificationResponse = z.object({
|
||||
notifications: z.array(zNotificationItemResponse),
|
||||
should_show: z.boolean(),
|
||||
})
|
||||
|
||||
export const zGetNotificationQuery = z.object({
|
||||
language: z.string().optional().default('en-US'),
|
||||
})
|
||||
|
||||
/**
|
||||
* Success — inspect should_show to decide whether to render the modal
|
||||
*/
|
||||
export const zGetNotificationResponse = zNotificationResponse
|
||||
|
||||
export const zPostNotificationDismissBody = zDismissNotificationPayload
|
||||
|
||||
/**
|
||||
* Success
|
||||
*/
|
||||
export const zPostNotificationDismissResponse = zSimpleResultResponse
|
||||
Reference in new issue
Block a user