mirror of
https://github.com/langgenius/dify.git
synced 2026-06-17 14:51:10 +08:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: fatelei <fatelei@gmail.com> Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com> Co-authored-by: gigglewang <gigglewang@dify.ai> Co-authored-by: Yunlu Wen <yunlu.wen@dify.ai> Co-authored-by: chariri <w@chariri.moe> Co-authored-by: Evan <2869018789@qq.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
88 lines
1.8 KiB
TypeScript
88 lines
1.8 KiB
TypeScript
import type { AppListResponse, WorkflowOnlineUsersResponse } from '@/models/app'
|
|
import type { CommonResponse } from '@/models/common'
|
|
import type { AppModeEnum } from '@/types/app'
|
|
import { type } from '@orpc/contract'
|
|
import { base } from '../base'
|
|
|
|
export type AppListSortBy = 'last_modified' | 'recently_created' | 'earliest_created'
|
|
type AppListMode = AppModeEnum | 'agent' | 'channel' | 'all'
|
|
|
|
export type AppListQuery = {
|
|
page?: number
|
|
limit?: number
|
|
name?: string
|
|
mode?: AppListMode
|
|
tag_ids?: string[]
|
|
creator_ids?: string[]
|
|
is_created_by_me?: boolean
|
|
sort_by?: AppListSortBy
|
|
}
|
|
|
|
export const appListContract = base
|
|
.route({
|
|
path: '/apps',
|
|
method: 'GET',
|
|
})
|
|
.input(type<{
|
|
query?: AppListQuery
|
|
}>())
|
|
.output(type<AppListResponse>())
|
|
|
|
export const appDeleteContract = base
|
|
.route({
|
|
path: '/apps/{appId}',
|
|
method: 'DELETE',
|
|
})
|
|
.input(type<{
|
|
params: {
|
|
appId: string
|
|
}
|
|
}>())
|
|
.output(type<unknown>())
|
|
|
|
export const appStarredListContract = base
|
|
.route({
|
|
path: '/apps/starred',
|
|
method: 'GET',
|
|
})
|
|
.input(type<{
|
|
query?: AppListQuery
|
|
}>())
|
|
.output(type<AppListResponse>())
|
|
|
|
export const appStarContract = base
|
|
.route({
|
|
path: '/apps/{appId}/star',
|
|
method: 'POST',
|
|
})
|
|
.input(type<{
|
|
params: {
|
|
appId: string
|
|
}
|
|
}>())
|
|
.output(type<CommonResponse>())
|
|
|
|
export const appUnstarContract = base
|
|
.route({
|
|
path: '/apps/{appId}/star',
|
|
method: 'DELETE',
|
|
})
|
|
.input(type<{
|
|
params: {
|
|
appId: string
|
|
}
|
|
}>())
|
|
.output(type<CommonResponse>())
|
|
|
|
export const workflowOnlineUsersContract = base
|
|
.route({
|
|
path: '/apps/workflows/online-users',
|
|
method: 'POST',
|
|
})
|
|
.input(type<{
|
|
body: {
|
|
app_ids: string[]
|
|
}
|
|
}>())
|
|
.output(type<WorkflowOnlineUsersResponse>())
|