explore.ts 766 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { del, get, patch, post } from './base'
  2. export const fetchAppList = () => {
  3. return get('/explore/apps')
  4. }
  5. export const fetchAppDetail = (id: string): Promise<any> => {
  6. return get(`/explore/apps/${id}`)
  7. }
  8. export const fetchInstalledAppList = () => {
  9. return get('/installed-apps')
  10. }
  11. export const installApp = (id: string) => {
  12. return post('/installed-apps', {
  13. body: {
  14. app_id: id,
  15. },
  16. })
  17. }
  18. export const uninstallApp = (id: string) => {
  19. return del(`/installed-apps/${id}`)
  20. }
  21. export const updatePinStatus = (id: string, isPinned: boolean) => {
  22. return patch(`/installed-apps/${id}`, {
  23. body: {
  24. is_pinned: isPinned,
  25. },
  26. })
  27. }
  28. export const getToolProviders = () => {
  29. return get('/workspaces/current/tool-providers')
  30. }