mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
fix(web): use generated account-profile contracts (#36927)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
import { type } from '@orpc/contract'
|
||||
import { base } from '../base'
|
||||
|
||||
export type AccountProfileResponse = {
|
||||
id: string
|
||||
name: string
|
||||
email: string
|
||||
avatar: string
|
||||
avatar_url: string | null
|
||||
is_password_set: boolean
|
||||
interface_language?: string
|
||||
interface_theme?: string
|
||||
timezone?: string
|
||||
last_login_at?: string
|
||||
last_active_at?: string
|
||||
last_login_ip?: string
|
||||
created_at?: string
|
||||
}
|
||||
|
||||
export const accountProfileContract = base
|
||||
.route({
|
||||
path: '/account/profile',
|
||||
method: 'GET',
|
||||
})
|
||||
.output(type<AccountProfileResponse>())
|
||||
|
||||
export const accountAvatarContract = base
|
||||
.route({
|
||||
path: '/account/avatar',
|
||||
method: 'GET',
|
||||
})
|
||||
.input(type<{
|
||||
query: {
|
||||
avatar: string
|
||||
}
|
||||
}>())
|
||||
.output(type<{ avatar_url: string }>())
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { InferContractRouterInputs } from '@orpc/contract'
|
||||
import { contract as communityContract } from '@dify/contracts/api/console/orpc.gen'
|
||||
import { contract as enterpriseContract } from '@dify/contracts/enterprise/orpc.gen'
|
||||
import { accountAvatarContract, accountProfileContract } from './console/account'
|
||||
import { appDeleteContract, appListContract, workflowOnlineUsersContract } from './console/apps'
|
||||
import { bindPartnerStackContract, invoicesContract } from './console/billing'
|
||||
import {
|
||||
@@ -71,14 +70,6 @@ export type MarketPlaceInputs = InferContractRouterInputs<typeof marketplaceRout
|
||||
export const consoleRouterContract = {
|
||||
enterprise: enterpriseContract,
|
||||
...communityContract,
|
||||
account: {
|
||||
...communityContract.account,
|
||||
avatar: accountAvatarContract,
|
||||
profile: {
|
||||
...communityContract.account.profile,
|
||||
get: accountProfileContract,
|
||||
},
|
||||
},
|
||||
apps: {
|
||||
...communityContract.apps,
|
||||
list: appListContract,
|
||||
|
||||
Reference in New Issue
Block a user