feat: TFS Sync

This commit is contained in:
Julien Froidefond
2025-09-22 21:51:12 +02:00
parent 472135a97f
commit 723a44df32
27 changed files with 3309 additions and 364 deletions

66
src/clients/tfs-client.ts Normal file
View File

@@ -0,0 +1,66 @@
/**
* Client HTTP pour TFS/Azure DevOps
* Gère les appels API côté frontend
*/
import { HttpClient } from './base/http-client';
export interface TfsSchedulerStatus {
running: boolean;
lastSync?: string;
nextSync?: string;
interval: 'hourly' | 'daily' | 'weekly';
tfsConfigured: boolean;
}
export class TfsClient extends HttpClient {
constructor() {
super();
}
/**
* Lance la synchronisation manuelle des Pull Requests TFS
*/
async syncPullRequests() {
return this.post('/api/tfs/sync', {});
}
/**
* Teste la connexion TFS
*/
async testConnection() {
return this.get('/api/tfs/sync');
}
/**
* Configure le scheduler TFS
*/
async configureScheduler(enabled: boolean, interval: 'hourly' | 'daily' | 'weekly') {
return this.post('/api/tfs/sync', {
action: 'config',
tfsAutoSync: enabled,
tfsSyncInterval: interval
});
}
/**
* Démarre/arrête le scheduler TFS
*/
async toggleScheduler(enabled: boolean) {
return this.post('/api/tfs/sync', {
action: 'scheduler',
enabled
});
}
/**
* Récupère le statut du scheduler TFS
*/
async getSchedulerStatus(): Promise<TfsSchedulerStatus> {
return this.get<TfsSchedulerStatus>('/api/tfs/scheduler/status');
}
}
// Export d'une instance singleton
export const tfsClient = new TfsClient();