MCPcopy Create free account
hub / github.com/Kong/insomnia / invokeVCSForWorkspace

Function invokeVCSForWorkspace

packages/insomnia/src/main/cloud-sync/vcs.ts:103–117  ·  view source on GitHub ↗
(
  sender: WebContents,
  methodName: MethodNames<VCS>,
  workspaceId: string,
  ...args: unknown[]
)

Source from the content-addressed store, hash-verified

101 ...args: VCS[K] extends (...args: any[]) => any ? Parameters<VCS[K]> : never
102): Promise<VCS[K] extends (...args: any[]) => any ? Awaited<ReturnType<VCS[K]>> : never>;
103export async function invokeVCSForWorkspace(
104 sender: WebContents,
105 methodName: MethodNames<VCS>,
106 workspaceId: string,
107 ...args: unknown[]
108) {
109 const vcs = getVCSForWorkspace(workspaceId);
110 const method = vcs[methodName];
111
112 if (typeof method !== 'function') {
113 throw new TypeError(`Unknown VCS method: ${String(methodName)}`);
114 }
115
116 return runWithSyncRenderer(sender, () => (method as (...args: unknown[]) => unknown).apply(vcs, args));
117}
118
119export const resolvePendingSyncConflict = ({
120 handlerId,

Callers 15

archiveProjectMethod · 0.90
checkoutMethod · 0.90
compareRemoteBranchMethod · 0.90
forkMethod · 0.90
getBranchNamesMethod · 0.90
getCurrentBranchNameMethod · 0.90
getHistoryMethod · 0.90
getHistoryCountMethod · 0.90
getRemoteBranchNamesMethod · 0.90
getVersionMethod · 0.90
hasBackendProjectMethod · 0.90

Calls 2

getVCSForWorkspaceFunction · 0.85
runWithSyncRendererFunction · 0.85

Tested by

no test coverage detected