Pick up changed ping API

This commit is contained in:
Andras Schmelczer 2025-03-29 12:28:12 +00:00
commit c5af0d40d8
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 20 additions and 7 deletions

View file

@ -284,14 +284,22 @@ export class SyncService {
} }
public async checkConnection(): Promise<CheckConnectionResult> { public async checkConnection(): Promise<CheckConnectionResult> {
const { vaultName } = this.settings.getSettings();
try { try {
const response = await this.pingClient.GET("/ping", { const response = await this.pingClient.GET(
"/vaults/{vault_id}/ping",
{
params: { params: {
header: { header: {
authorization: `Bearer ${this.settings.getSettings().token}` authorization: `Bearer ${this.settings.getSettings().token}`
},
path: {
vault_id: vaultName
} }
} }
}); }
);
this.logger.debug( this.logger.debug(
`Ping response: ${JSON.stringify(response.data)}` `Ping response: ${JSON.stringify(response.data)}`

View file

@ -4,7 +4,7 @@
*/ */
export interface paths { export interface paths {
"/ping": { "/vaults/{vault_id}/ping": {
parameters: { parameters: {
query?: never; query?: never;
header?: never; header?: never;
@ -17,7 +17,9 @@ export interface paths {
header?: { header?: {
authorization?: string; authorization?: string;
}; };
path?: never; path: {
vault_id: string;
};
cookie?: never; cookie?: never;
}; };
requestBody?: never; requestBody?: never;
@ -555,6 +557,9 @@ export interface components {
lastUpdateId: number; lastUpdateId: number;
latestDocuments: components["schemas"]["DocumentVersionWithoutContent"][]; latestDocuments: components["schemas"]["DocumentVersionWithoutContent"][];
}; };
PingPathParams: {
vault_id: string;
};
/** @description Response to a ping request. */ /** @description Response to a ping request. */
PingResponse: { PingResponse: {
/** @description Whether the client is authenticated based on the sent Authorization header. */ /** @description Whether the client is authenticated based on the sent Authorization header. */