feat(sync): add sync subsystem: SyncManager, OpsServer sync handlers, Sync UI and state, provider groupFilter support, and realtime sync log streaming via TypedSocket
This commit is contained in:
36
ts_interfaces/data/sync.ts
Normal file
36
ts_interfaces/data/sync.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
export type TSyncStatus = 'active' | 'paused' | 'error';
|
||||
|
||||
export interface ISyncConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
sourceConnectionId: string;
|
||||
targetConnectionId: string;
|
||||
targetGroupOffset?: string; // Path prefix for target repos (e.g. "mirror/gitlab")
|
||||
intervalMinutes: number; // Default 5
|
||||
status: TSyncStatus;
|
||||
lastSyncAt: number;
|
||||
lastSyncError?: string;
|
||||
lastSyncDurationMs?: number;
|
||||
reposSynced: number;
|
||||
enforceDelete: boolean; // When true, stale target repos are moved to obsolete
|
||||
enforceGroupDelete: boolean; // When true, stale target groups/orgs are moved to obsolete
|
||||
addMirrorHint?: boolean; // When true, target descriptions get "(This is a mirror of ...)" appended
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
export interface ISyncRepoStatus {
|
||||
id: string;
|
||||
syncConfigId: string;
|
||||
sourceFullPath: string; // e.g. "push.rocks/smartstate"
|
||||
targetFullPath: string; // e.g. "foss.global/push.rocks/smartstate"
|
||||
lastSyncAt: number;
|
||||
lastSyncError?: string;
|
||||
status: 'synced' | 'error' | 'pending';
|
||||
}
|
||||
|
||||
export interface ISyncLogEntry {
|
||||
timestamp: number;
|
||||
level: 'info' | 'warn' | 'error' | 'success' | 'debug';
|
||||
message: string;
|
||||
source?: string; // e.g. 'preview', 'sync', 'git', 'api'
|
||||
}
|
||||
Reference in New Issue
Block a user