MCPcopy Create free account
hub / github.com/bitwarden/clients / run

Method run

apps/cli/src/vault/sync.command.ts:13–28  ·  view source on GitHub ↗
(cmdOptions: Record<string, any>)

Source from the content-addressed store, hash-verified

11 constructor(private syncService: SyncService) {}
12
13 async run(cmdOptions: Record<string, any>): Promise<Response> {
14 const normalizedOptions = new Options(cmdOptions);
15 if (normalizedOptions.last) {
16 return await this.getLastSync();
17 }
18
19 try {
20 await this.syncService.fullSync(normalizedOptions.force, true);
21 const res = new MessageResponse("Syncing complete.", null);
22 return Response.success(res);
23 } catch (e) {
24 const response = Response.error(e);
25 response.message = "Syncing failed: " + response.message;
26 return response;
27 }
28 }
29
30 private async getLastSync() {
31 const lastSyncDate = await this.syncService.getLastSync();

Callers 7

bootstrapMethod · 0.45
ngOnInitMethod · 0.45
ngOnInitMethod · 0.45
initMethod · 0.45
configureRouterMethod · 0.45
initMethod · 0.45

Calls 4

getLastSyncMethod · 0.95
successMethod · 0.80
errorMethod · 0.65
fullSyncMethod · 0.45

Tested by

no test coverage detected