mirror of
https://github.com/YFGaia/dify-plus.git
synced 2026-06-04 10:14:00 +08:00
b2f5707676
# Conflicts: # .github/workflows/tool-test-sdks.yaml # api/.env.example # api/README.md # api/commands.py # api/controllers/console/explore/wraps.py # api/controllers/web/workflow.py # api/extensions/ext_commands.py # api/models/model.py # api/pyproject.toml # api/services/feature_service.py # web/README.md # web/app/components/explore/app-card/index.tsx # web/app/components/explore/app-list/index.tsx # web/app/components/explore/sidebar/index.tsx # web/app/signin/components/mail-and-password-auth.tsx # web/i18n/uk-UA/app-overview.json # web/i18n/uk-UA/app.json # web/i18n/uk-UA/billing.json # web/i18n/uk-UA/common.json # web/i18n/uk-UA/dataset-creation.json # web/i18n/uk-UA/dataset-documents.json # web/i18n/uk-UA/dataset-hit-testing.json # web/i18n/uk-UA/dataset-settings.json # web/i18n/uk-UA/dataset.json # web/i18n/uk-UA/explore.json # web/i18n/uk-UA/plugin.json # web/i18n/uk-UA/tools.json # web/next.config.js # web/package.json # web/pnpm-lock.yaml # web/service/common.ts # web/service/explore.ts # web/service/fetch.ts # web/service/use-explore.ts # web/types/feature.ts
51 lines
1.5 KiB
TypeScript
51 lines
1.5 KiB
TypeScript
import type { AccessMode } from '@/models/access-control'
|
|
import type { Banner } from '@/models/app'
|
|
import type { App, AppCategory } from '@/models/explore'
|
|
import { del, get, patch } from './base'
|
|
|
|
export const fetchAppList = () => {
|
|
return get<{
|
|
categories: AppCategory[]
|
|
recommended_apps: App[]
|
|
}>('/explore/apps')
|
|
}
|
|
|
|
// -------------- extend: start fetch Open Installed App List ---------------
|
|
export const fetchOpenInstalledAppList = () => {
|
|
return get<{
|
|
categories: AppCategory[]
|
|
recommended_apps: App[]
|
|
}>('/installed/apps')
|
|
}
|
|
// -------------- extend: stop fetch Open Installed App List ---------------
|
|
|
|
// eslint-disable-next-line ts/no-explicit-any
|
|
export const fetchAppDetail = (id: string): Promise<any> => {
|
|
return get(`/explore/apps/${id}`)
|
|
}
|
|
|
|
export const fetchInstalledAppList = (app_id?: string | null) => {
|
|
return get(`/installed-apps${app_id ? `?app_id=${app_id}` : ''}`)
|
|
}
|
|
|
|
export const uninstallApp = (id: string) => {
|
|
return del(`/installed-apps/${id}`)
|
|
}
|
|
|
|
export const updatePinStatus = (id: string, isPinned: boolean) => {
|
|
return patch(`/installed-apps/${id}`, {
|
|
body: {
|
|
is_pinned: isPinned,
|
|
},
|
|
})
|
|
}
|
|
|
|
export const getAppAccessModeByAppId = (appId: string) => {
|
|
return get<{ accessMode: AccessMode }>(`/enterprise/webapp/app/access-mode?appId=${appId}`)
|
|
}
|
|
|
|
export const fetchBanners = (language?: string): Promise<Banner[]> => {
|
|
const url = language ? `/explore/banners?language=${language}` : '/explore/banners'
|
|
return get<Banner[]>(url)
|
|
}
|