mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
refactor(api): co-locate server-protocol clients into lib/api
Move the Subsonic + Navidrome protocol clients and the library IPC facade (subsonic*, navidrome*, library.ts + tests) from src/api/ into src/lib/api/, the feature-free infra layer (plan M4, decision §10.3: shared client core → lib/). Pure move: deep-path import specifiers @/api/* -> @/lib/api/* across ~150 consumers; no behaviour change. Domain REST (lyrics/events) and cover/analysis infra stay in src/api/ pending their own M4 placement. tsc 0, lint 0/0, full suite 319 files / 2353 tests green.
This commit is contained in:
@@ -19,8 +19,8 @@ import {
|
||||
libraryAnalysisProgress,
|
||||
type LibraryAnalysisProgressDto,
|
||||
} from '@/api/analysis';
|
||||
import { libraryGetTracksBatch, type LibraryTrackDto, type TrackRefDto } from '@/api/library';
|
||||
import { buildStreamUrlForServer } from '@/api/subsonicStreamUrl';
|
||||
import { libraryGetTracksBatch, type LibraryTrackDto, type TrackRefDto } from '@/lib/api/library';
|
||||
import { buildStreamUrlForServer } from '@/lib/api/subsonicStreamUrl';
|
||||
import { serverListDisplayLabel } from '@/utils/server/serverDisplayName';
|
||||
import { serverIndexKeyForProfile } from '@/utils/server/serverIndexKey';
|
||||
import { showToast } from '@/utils/ui/toast';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RefreshCw, ShieldCheck, WifiOff, Zap } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { SyncStateDto } from '@/api/library';
|
||||
import type { SyncStateDto } from '@/lib/api/library';
|
||||
import {
|
||||
libraryStatusDisplayTrackCount,
|
||||
libraryStatusIsReady,
|
||||
|
||||
@@ -7,12 +7,12 @@ import { useAuthStore } from '@/store/authStore';
|
||||
import { formatServerSoftware, isNavidromeAudiomuseSoftwareEligible, type InstantMixProbeResult, type SubsonicServerIdentity } from '@/utils/server/subsonicServerIdentity';
|
||||
import { buildCapabilityContext } from '@/serverCapabilities/context';
|
||||
import { useLibraryIndexStore } from '@/store/libraryIndexStore';
|
||||
import { libraryDeleteServerData, librarySyncClearSession } from '@/api/library';
|
||||
import { libraryDeleteServerData, librarySyncClearSession } from '@/lib/api/library';
|
||||
import { bootstrapIndexedServer } from '@/utils/library/librarySession';
|
||||
import { useLibraryIndexSync } from '@/hooks/useLibraryIndexSync';
|
||||
import ServerLibraryIndexControls from '@/features/settings/components/ServerLibraryIndexControls';
|
||||
import type { ServerProfile } from '@/store/authStoreTypes';
|
||||
import { pingWithCredentialsForProfile, scheduleInstantMixProbeForServer } from '@/api/subsonic';
|
||||
import { pingWithCredentialsForProfile, scheduleInstantMixProbeForServer } from '@/lib/api/subsonic';
|
||||
import {
|
||||
clearServerHttpContext,
|
||||
syncServerHttpContextForProfile,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Shield, Wand2 } from 'lucide-react';
|
||||
import { ndUpdateUser, type NdLibrary, type NdUser } from '@/api/navidromeAdmin';
|
||||
import { ndUpdateUser, type NdLibrary, type NdUser } from '@/lib/api/navidromeAdmin';
|
||||
import { showToast } from '@/utils/ui/toast';
|
||||
import {
|
||||
copyTextToClipboard,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { RotateCcw, UserPlus, Users } from 'lucide-react';
|
||||
import type { NdUser } from '@/api/navidromeAdmin';
|
||||
import type { NdUser } from '@/lib/api/navidromeAdmin';
|
||||
import ConfirmModal from '@/components/ConfirmModal';
|
||||
import { useUserMgmtData } from '@/features/settings/hooks/useUserMgmtData';
|
||||
import { useUserMgmtActions } from '@/features/settings/hooks/useUserMgmtActions';
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { X } from 'lucide-react';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { ndUpdateUser, type NdUser } from '@/api/navidromeAdmin';
|
||||
import { ndUpdateUser, type NdUser } from '@/lib/api/navidromeAdmin';
|
||||
import { showToast } from '@/utils/ui/toast';
|
||||
import {
|
||||
copyTextToClipboard,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { Shield, Trash2, User, Wand2 } from 'lucide-react';
|
||||
import type { i18n as I18nType, TFunction } from 'i18next';
|
||||
import type { NdLibrary, NdUser } from '@/api/navidromeAdmin';
|
||||
import type { NdLibrary, NdUser } from '@/lib/api/navidromeAdmin';
|
||||
import { formatLastSeen } from '@/utils/componentHelpers/userMgmtHelpers';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
ndUpdateUser,
|
||||
type NdLibrary,
|
||||
type NdUser,
|
||||
} from '@/api/navidromeAdmin';
|
||||
} from '@/lib/api/navidromeAdmin';
|
||||
import { showToast } from '@/utils/ui/toast';
|
||||
import {
|
||||
copyTextToClipboard,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
ndListUsers,
|
||||
type NdLibrary,
|
||||
type NdUser,
|
||||
} from '@/api/navidromeAdmin';
|
||||
} from '@/lib/api/navidromeAdmin';
|
||||
|
||||
interface UseUserMgmtDataResult {
|
||||
users: NdUser[];
|
||||
|
||||
@@ -20,7 +20,7 @@ import { SystemTab } from '@/features/settings/components/SystemTab';
|
||||
import { searchSettings, type SettingsSearchHit } from '@/features/settings/components/settingsSearch';
|
||||
import { type Tab, resolveTab } from '@/features/settings/components/settingsTabs';
|
||||
import { UserManagementSection } from '@/features/settings/components/UserManagementSection';
|
||||
import { ndLogin } from '@/api/navidromeAdmin';
|
||||
import { ndLogin } from '@/lib/api/navidromeAdmin';
|
||||
import { type ServerMagicPayload } from '@/utils/server/serverMagicString';
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user