Fix compile
This commit is contained in:
parent
06ca180425
commit
78ba74b844
1 changed files with 38 additions and 0 deletions
|
|
@ -245,6 +245,44 @@ export class SyncService {
|
|||
});
|
||||
}
|
||||
|
||||
public async getAll(
|
||||
since?: VaultUpdateId
|
||||
): Promise<components["schemas"]["FetchLatestDocumentsResponse"]> {
|
||||
return this.withRetries(async () => {
|
||||
const { vaultName } = this.settings.getSettings();
|
||||
|
||||
const response = await this.client.GET(
|
||||
"/vaults/{vault_id}/documents",
|
||||
{
|
||||
params: {
|
||||
path: {
|
||||
vault_id: vaultName
|
||||
},
|
||||
header: {
|
||||
authorization: `Bearer ${this.settings.getSettings().token}`
|
||||
},
|
||||
query: {
|
||||
since_update_id: since
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const { error } = response;
|
||||
if (error) {
|
||||
throw new Error(
|
||||
`Failed to get documents: ${SyncService.formatError(response.error)}`
|
||||
);
|
||||
}
|
||||
|
||||
this.logger.debug(
|
||||
`Got ${response.data.latestDocuments.length} document metadata`
|
||||
);
|
||||
|
||||
return response.data;
|
||||
});
|
||||
}
|
||||
|
||||
public async checkConnection(): Promise<CheckConnectionResult> {
|
||||
try {
|
||||
const response = await this.pingClient.GET("/ping", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue