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:
yyhandautofix-ci[bot] authored and GitHub committed 2026-06-02 07:28:05 +00:00
1 parent 3cd0da303a
commit dea4e66456
34 files changed
+268 -151

No files matched your search

@@ -1,4 +1,4 @@
import type { AccountProfileResponse } from '@/contract/console/account'
import type { GetAccountProfileResponse } from '@dify/contracts/api/console/account/types.gen'
import { QueryClient } from '@tanstack/react-query'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { resolveServerConsoleApiUrl } from '@/service/server'
@@ -18,7 +18,7 @@ vi.mock('@/next/headers', () => ({
cookies: () => cookiesMock(),
}))
const createProfile = (overrides: Partial<AccountProfileResponse> = {}): AccountProfileResponse => ({
const createProfile = (overrides: Partial<GetAccountProfileResponse> = {}): GetAccountProfileResponse => ({
id: 'account-id',
name: 'Dify User',
email: 'user@example.com',
+3 -3
View File
@@ -1,4 +1,4 @@
import type { AccountProfileResponse } from '@/contract/console/account'
import type { GetAccountProfileResponse } from '@dify/contracts/api/console/account/types.gen'
import { queryOptions } from '@tanstack/react-query'
import { IS_DEV } from '@/config'
// eslint-disable-next-line no-restricted-imports
@@ -6,7 +6,7 @@ import { get } from '@/service/base'
import { consoleQuery } from '@/service/client'
export type UserProfileWithMeta = {
profile: AccountProfileResponse
profile: GetAccountProfileResponse
meta: {
currentVersion: string | null
currentEnv: string | null
@@ -24,7 +24,7 @@ export const userProfileQueryOptions = () =>
needAllResponseContent: true,
silent: true,
})
const profile: AccountProfileResponse = await response.clone().json()
const profile: GetAccountProfileResponse = await response.clone().json()
return {
profile,
meta: {
+2 -2
View File
@@ -1,5 +1,5 @@
import type { GetAccountProfileResponse } from '@dify/contracts/api/console/account/types.gen'
import type { UserProfileWithMeta } from './client'
import type { AccountProfileResponse } from '@/contract/console/account'
import { queryOptions } from '@tanstack/react-query'
import { getServerConsoleRequestHeaders, resolveServerConsoleApiUrl, serverConsoleQuery } from '@/service/server'
@@ -22,7 +22,7 @@ export const serverUserProfileQueryOptions = () =>
if (!response.ok)
throw response
const profile: AccountProfileResponse = await response.clone().json()
const profile: GetAccountProfileResponse = await response.clone().json()
return {
profile,
meta: {