add resetTor to rpc client

This commit is contained in:
Matt Hill
2023-06-07 16:37:36 -06:00
committed by Matt Hill
parent eb6cd23772
commit b86a97c9c0
4 changed files with 19 additions and 2 deletions

View File

@@ -62,6 +62,12 @@ export module RR {
export type SystemRebuildReq = {} // server.rebuild export type SystemRebuildReq = {} // server.rebuild
export type SystemRebuildRes = null export type SystemRebuildRes = null
export type ResetTorReq = {
'wipe-state': boolean
reason: string
} // net.tor.reset
export type ResetTorRes = null
// sessions // sessions
export type GetSessionsReq = {} // sessions.list export type GetSessionsReq = {} // sessions.list

View File

@@ -111,6 +111,8 @@ export abstract class ApiService {
abstract repairDisk(params: RR.SystemRebuildReq): Promise<RR.SystemRebuildRes> abstract repairDisk(params: RR.SystemRebuildReq): Promise<RR.SystemRebuildRes>
abstract resetTor(params: RR.ResetTorReq): Promise<RR.ResetTorRes>
// marketplace URLs // marketplace URLs
abstract marketplaceProxy<T>( abstract marketplaceProxy<T>(

View File

@@ -136,7 +136,7 @@ export class LiveApiService extends ApiService {
} }
async getTorLogs(params: RR.GetServerLogsReq): Promise<RR.GetServerLogsRes> { async getTorLogs(params: RR.GetServerLogsReq): Promise<RR.GetServerLogsRes> {
return this.rpcRequest({ method: 'server.tor-logs', params }) return this.rpcRequest({ method: 'net.tor.logs', params })
} }
async followServerLogs( async followServerLogs(
@@ -154,7 +154,7 @@ export class LiveApiService extends ApiService {
async followTorLogs( async followTorLogs(
params: RR.FollowServerLogsReq, params: RR.FollowServerLogsReq,
): Promise<RR.FollowServerLogsRes> { ): Promise<RR.FollowServerLogsRes> {
return this.rpcRequest({ method: 'server.tor-logs.follow', params }) return this.rpcRequest({ method: 'net.tor.logs.follow', params })
} }
async getServerMetrics( async getServerMetrics(
@@ -192,6 +192,10 @@ export class LiveApiService extends ApiService {
return this.rpcRequest({ method: 'disk.repair', params }) return this.rpcRequest({ method: 'disk.repair', params })
} }
async resetTor(params: RR.ResetTorReq): Promise<RR.ResetTorRes> {
return this.rpcRequest({ method: 'net.tor.reset', params })
}
// marketplace URLs // marketplace URLs
async marketplaceProxy<T>( async marketplaceProxy<T>(

View File

@@ -322,6 +322,11 @@ export class MockApiService extends ApiService {
return null return null
} }
async resetTor(params: RR.ResetTorReq): Promise<RR.ResetTorRes> {
await pauseFor(2000)
return null
}
// marketplace URLs // marketplace URLs
async marketplaceProxy( async marketplaceProxy(