chore: weitere Code-Aufteilung (api.ts, hooks, ldap_sync)
- src/lib/api.ts (1085 Zeilen) → 5 thematische Module unter src/lib/api/ (core, users, ldap, tenants, mail, system) + index.ts Re-Export - useLDAPConfig / useTenantLDAPConfig / useTenantUsers Hooks extrahiert; admin/page.tsx nutzt diese statt roher useState-Blöcke - handleSyncTenantLDAP, handleAdminSyncTenantLDAP, doSyncTenantLDAP, buildTenantTestConfig, syncResult aus ldap_tenants.go in ldap_sync.go verschoben Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,161 @@
|
||||
// Re-export everything from domain modules so that existing imports
|
||||
// from "@/lib/api" continue to work without modification.
|
||||
|
||||
export { API_BASE, request } from "./core";
|
||||
|
||||
export type {
|
||||
LoginResponse,
|
||||
User,
|
||||
MeResponse,
|
||||
CreateUserRequest,
|
||||
UpdateUserRequest,
|
||||
} from "./users";
|
||||
export {
|
||||
login,
|
||||
getMe,
|
||||
logout,
|
||||
changePassword,
|
||||
changeEmail,
|
||||
getUsers,
|
||||
createUser,
|
||||
updateUser,
|
||||
deleteUser,
|
||||
getTOTPSetup,
|
||||
confirmTOTPSetup,
|
||||
disableTOTP,
|
||||
} from "./users";
|
||||
|
||||
export type {
|
||||
LDAPGroupMapping,
|
||||
LDAPConfig,
|
||||
LDAPTestUser,
|
||||
LDAPTestResult,
|
||||
} from "./ldap";
|
||||
export {
|
||||
getLDAPConfig,
|
||||
saveLDAPConfig,
|
||||
deleteLDAPConfig,
|
||||
testLDAPConfig,
|
||||
} from "./ldap";
|
||||
|
||||
export type {
|
||||
Tenant,
|
||||
TenantDomain,
|
||||
TenantDefaultUser,
|
||||
CreateTenantResponse,
|
||||
TenantLDAPConfig,
|
||||
LDAPSyncResult,
|
||||
} from "./tenants";
|
||||
export {
|
||||
getTenants,
|
||||
getTenantUsers,
|
||||
createTenant,
|
||||
updateTenant,
|
||||
deleteTenant,
|
||||
getTenantDomains,
|
||||
addTenantDomain,
|
||||
removeTenantDomain,
|
||||
getTenantLogoUrl,
|
||||
uploadTenantLogo,
|
||||
deleteTenantLogo,
|
||||
uploadMyTenantLogo,
|
||||
deleteMyTenantLogo,
|
||||
getTenantLDAPConfig,
|
||||
saveTenantLDAPConfig,
|
||||
deleteTenantLDAPConfig,
|
||||
testTenantLDAPConfig,
|
||||
getAdminTenantLDAPConfig,
|
||||
saveAdminTenantLDAPConfig,
|
||||
deleteAdminTenantLDAPConfig,
|
||||
testAdminTenantLDAPConfig,
|
||||
syncAdminTenantLDAP,
|
||||
} from "./tenants";
|
||||
|
||||
export type {
|
||||
SearchHit,
|
||||
SearchResponse,
|
||||
MailAttachment,
|
||||
MailDetail,
|
||||
ImapFolder,
|
||||
ImapAccount,
|
||||
ImapTestResult,
|
||||
Pop3Account,
|
||||
Pop3TestResult,
|
||||
UploadJob,
|
||||
} from "./mail";
|
||||
export {
|
||||
searchEmails,
|
||||
getMail,
|
||||
downloadMailAttachment,
|
||||
downloadMailRaw,
|
||||
getImapAccounts,
|
||||
createImapAccount,
|
||||
deleteImapAccount,
|
||||
testImapConnection,
|
||||
startImapImport,
|
||||
getImapProgress,
|
||||
triggerImapSync,
|
||||
updateImapInterval,
|
||||
updateImapAccount,
|
||||
getPop3Accounts,
|
||||
createPop3Account,
|
||||
deletePop3Account,
|
||||
testPop3Connection,
|
||||
startPop3Import,
|
||||
getPop3Progress,
|
||||
exportMailPDF,
|
||||
exportMailsZIP,
|
||||
uploadMailFiles,
|
||||
getUploadProgress,
|
||||
uploadMailFilesUser,
|
||||
getUploadProgressUser,
|
||||
} from "./mail";
|
||||
|
||||
export type {
|
||||
HealthResponse,
|
||||
SMTPStatus,
|
||||
StorageStats,
|
||||
ServiceStatus,
|
||||
AuditEntry,
|
||||
AuditResponse,
|
||||
SystemStatsCPU,
|
||||
SystemStatsRAM,
|
||||
SystemStatsDisk,
|
||||
SystemStatsMailInfo,
|
||||
SystemStats,
|
||||
SecurityCheck,
|
||||
SecurityAuditResult,
|
||||
MailLabel,
|
||||
LabelRule,
|
||||
CertInfo,
|
||||
SelfSignedRequest,
|
||||
ACMERequest,
|
||||
} from "./system";
|
||||
export {
|
||||
getHealth,
|
||||
getSMTPStatus,
|
||||
getStorageStats,
|
||||
getSystemStats,
|
||||
getServices,
|
||||
serviceAction,
|
||||
getAuditLog,
|
||||
getSecurityAudit,
|
||||
fixSecurityIssue,
|
||||
getLabels,
|
||||
createLabel,
|
||||
updateLabel,
|
||||
deleteLabel,
|
||||
assignLabel,
|
||||
removeLabelFromEmail,
|
||||
getMailLabelIds,
|
||||
createAdminLabel,
|
||||
getAdminLabels,
|
||||
deleteAdminLabel,
|
||||
getLabelRules,
|
||||
createLabelRule,
|
||||
deleteLabelRule,
|
||||
getCertInfo,
|
||||
uploadCert,
|
||||
generateSelfSignedCert,
|
||||
requestACMECert,
|
||||
} from "./system";
|
||||
Reference in New Issue
Block a user