mirror of
https://github.com/langgenius/dify.git
synced 2026-10-29 18:07:39 +08:00
perf(web): streaming ssr for home page (#39922)
This commit is contained in:
@@ -41,12 +41,12 @@ export type RecommendedAppDetailResponse = {
|
||||
}
|
||||
|
||||
export type BannerResponse = {
|
||||
content: unknown
|
||||
created_at?: string | null
|
||||
content: BannerContentResponse
|
||||
created_at: string
|
||||
id: string
|
||||
link?: string | null
|
||||
link: string
|
||||
sort: number
|
||||
status: string
|
||||
status: BannerStatus
|
||||
}
|
||||
|
||||
export type RecommendedAppInfoResponse = {
|
||||
@@ -59,6 +59,15 @@ export type RecommendedAppInfoResponse = {
|
||||
name?: string | null
|
||||
}
|
||||
|
||||
export type BannerContentResponse = {
|
||||
category: string
|
||||
description: string
|
||||
'img-src': string
|
||||
title: string
|
||||
}
|
||||
|
||||
export type BannerStatus = 'disabled' | 'enabled'
|
||||
|
||||
export type RecommendedAppListResponseWritable = {
|
||||
categories: Array<string>
|
||||
recommended_apps: Array<RecommendedAppResponseWritable>
|
||||
|
||||
@@ -20,23 +20,6 @@ export const zRecommendedAppDetailResponse = z.object({
|
||||
*/
|
||||
export const zRecommendedAppDetailNullableResponse = zRecommendedAppDetailResponse.nullable()
|
||||
|
||||
/**
|
||||
* BannerResponse
|
||||
*/
|
||||
export const zBannerResponse = z.object({
|
||||
content: z.unknown(),
|
||||
created_at: z.string().nullish(),
|
||||
id: z.string(),
|
||||
link: z.string().nullish(),
|
||||
sort: z.int(),
|
||||
status: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* BannerListResponse
|
||||
*/
|
||||
export const zBannerListResponse = z.array(zBannerResponse)
|
||||
|
||||
/**
|
||||
* RecommendedAppInfoResponse
|
||||
*/
|
||||
@@ -81,6 +64,40 @@ export const zLearnDifyAppListResponse = z.object({
|
||||
recommended_apps: z.array(zRecommendedAppResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* BannerContentResponse
|
||||
*/
|
||||
export const zBannerContentResponse = z.object({
|
||||
category: z.string(),
|
||||
description: z.string(),
|
||||
'img-src': z.string().min(1),
|
||||
title: z.string().min(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* BannerStatus
|
||||
*
|
||||
* ExporleBanner status
|
||||
*/
|
||||
export const zBannerStatus = z.enum(['disabled', 'enabled'])
|
||||
|
||||
/**
|
||||
* BannerResponse
|
||||
*/
|
||||
export const zBannerResponse = z.object({
|
||||
content: zBannerContentResponse,
|
||||
created_at: z.string(),
|
||||
id: z.string(),
|
||||
link: z.string(),
|
||||
sort: z.int(),
|
||||
status: zBannerStatus,
|
||||
})
|
||||
|
||||
/**
|
||||
* BannerListResponse
|
||||
*/
|
||||
export const zBannerListResponse = z.array(zBannerResponse)
|
||||
|
||||
/**
|
||||
* RecommendedAppInfoResponse
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user