diff --git a/src/client.ts b/src/client.ts index 519fea1..e359322 100644 --- a/src/client.ts +++ b/src/client.ts @@ -21,6 +21,7 @@ import type { GetExportResponse, GetMeResponse, IssueApiTokenResponse, + RotateApiTokenResponse, JWKSResponse, HealthResponse, AuthRegisterResponse, @@ -137,6 +138,10 @@ export class ElydoraClient { return this.request('POST', '/v1/auth/token', { ttl_seconds: ttlSeconds ?? null }); } + async rotateApiToken(): Promise { + return this.request('POST', '/v1/auth/rotate', {}); + } + // ------------------------------------------------------------------------- // Agent management // ------------------------------------------------------------------------- @@ -241,7 +246,7 @@ export class ElydoraClient { } async verifyOperation(operationId: string): Promise { - return this.request('POST', `/v1/operations/${encodeURIComponent(operationId)}/verify`); + return this.request('POST', `/v1/operations/${encodeURIComponent(operationId)}/verify`, {}); } // ------------------------------------------------------------------------- diff --git a/src/index.ts b/src/index.ts index 284ab9a..cc56bf8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -62,6 +62,7 @@ export type { ListExportsResponse, GetMeResponse, IssueApiTokenResponse, + RotateApiTokenResponse, JWK, JWKSResponse, HealthResponse, diff --git a/src/types.ts b/src/types.ts index 3cf230f..a187b5c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -266,6 +266,14 @@ export interface GetMeResponse { export interface IssueApiTokenResponse { readonly token: string; readonly expires_at: number | null; + readonly token_id: string; +} + +export interface RotateApiTokenResponse { + readonly token: string; + readonly expires_at: number | null; + readonly token_id: string; + readonly previous_token_grace_until: number; } export interface HealthResponse {