- Set sync concurrency to 10 for faster parallel repo syncing - Three-phase push: push refs, sync default_branch via API, then push with --prune - Unprotect stale protected branches on target before pruning - Handle group visibility 400 errors gracefully (skip visibility, sync description only) - Add useGroupAvatarsForProjects option: projects without avatars inherit group avatar - Upgrade @apiclient.xyz/gitlab to v2.3.0 (getProtectedBranches, unprotectBranch)
158 lines
3.7 KiB
TypeScript
158 lines
3.7 KiB
TypeScript
import * as plugins from '../plugins.ts';
|
|
import * as data from '../data/index.ts';
|
|
|
|
export interface IReq_GetSyncConfigs extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetSyncConfigs
|
|
> {
|
|
method: 'getSyncConfigs';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
};
|
|
response: {
|
|
configs: data.ISyncConfig[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_CreateSyncConfig extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_CreateSyncConfig
|
|
> {
|
|
method: 'createSyncConfig';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
name: string;
|
|
sourceConnectionId: string;
|
|
targetConnectionId: string;
|
|
targetGroupOffset?: string;
|
|
intervalMinutes?: number;
|
|
enforceDelete?: boolean;
|
|
enforceGroupDelete?: boolean;
|
|
addMirrorHint?: boolean;
|
|
useGroupAvatarsForProjects?: boolean;
|
|
};
|
|
response: {
|
|
config: data.ISyncConfig;
|
|
};
|
|
}
|
|
|
|
export interface IReq_UpdateSyncConfig extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_UpdateSyncConfig
|
|
> {
|
|
method: 'updateSyncConfig';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
syncConfigId: string;
|
|
name?: string;
|
|
targetGroupOffset?: string;
|
|
intervalMinutes?: number;
|
|
enforceDelete?: boolean;
|
|
enforceGroupDelete?: boolean;
|
|
addMirrorHint?: boolean;
|
|
useGroupAvatarsForProjects?: boolean;
|
|
};
|
|
response: {
|
|
config: data.ISyncConfig;
|
|
};
|
|
}
|
|
|
|
export interface IReq_DeleteSyncConfig extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_DeleteSyncConfig
|
|
> {
|
|
method: 'deleteSyncConfig';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
syncConfigId: string;
|
|
};
|
|
response: {
|
|
ok: boolean;
|
|
};
|
|
}
|
|
|
|
export interface IReq_PauseSyncConfig extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_PauseSyncConfig
|
|
> {
|
|
method: 'pauseSyncConfig';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
syncConfigId: string;
|
|
paused: boolean;
|
|
};
|
|
response: {
|
|
config: data.ISyncConfig;
|
|
};
|
|
}
|
|
|
|
export interface IReq_TriggerSync extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_TriggerSync
|
|
> {
|
|
method: 'triggerSync';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
syncConfigId: string;
|
|
};
|
|
response: {
|
|
ok: boolean;
|
|
message: string;
|
|
};
|
|
}
|
|
|
|
export interface IReq_PreviewSync extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_PreviewSync
|
|
> {
|
|
method: 'previewSync';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
syncConfigId: string;
|
|
};
|
|
response: {
|
|
mappings: Array<{ sourceFullPath: string; targetFullPath: string }>;
|
|
deletions: string[];
|
|
groupDeletions: string[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetSyncRepoStatuses extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetSyncRepoStatuses
|
|
> {
|
|
method: 'getSyncRepoStatuses';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
syncConfigId: string;
|
|
};
|
|
response: {
|
|
statuses: data.ISyncRepoStatus[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_GetSyncLogs extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_GetSyncLogs
|
|
> {
|
|
method: 'getSyncLogs';
|
|
request: {
|
|
identity: data.IIdentity;
|
|
limit?: number;
|
|
};
|
|
response: {
|
|
logs: data.ISyncLogEntry[];
|
|
};
|
|
}
|
|
|
|
export interface IReq_PushSyncLog extends plugins.typedrequestInterfaces.implementsTR<
|
|
plugins.typedrequestInterfaces.ITypedRequest,
|
|
IReq_PushSyncLog
|
|
> {
|
|
method: 'pushSyncLog';
|
|
request: {
|
|
entry: data.ISyncLogEntry;
|
|
};
|
|
response: {};
|
|
}
|