mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:17:40 +00:00
Gateway/CLI: add paired-device remove and clear flows (#20057)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 26523f8a38
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
This commit is contained in:
@@ -321,6 +321,22 @@ export async function rejectDevicePairing(
|
||||
});
|
||||
}
|
||||
|
||||
export async function removePairedDevice(
|
||||
deviceId: string,
|
||||
baseDir?: string,
|
||||
): Promise<{ deviceId: string } | null> {
|
||||
return await withLock(async () => {
|
||||
const state = await loadState(baseDir);
|
||||
const normalized = normalizeDeviceId(deviceId);
|
||||
if (!normalized || !state.pairedByDeviceId[normalized]) {
|
||||
return null;
|
||||
}
|
||||
delete state.pairedByDeviceId[normalized];
|
||||
await persistState(state, baseDir);
|
||||
return { deviceId: normalized };
|
||||
});
|
||||
}
|
||||
|
||||
export async function updatePairedDeviceMetadata(
|
||||
deviceId: string,
|
||||
patch: Partial<Omit<PairedDevice, "deviceId" | "createdAtMs" | "approvedAtMs">>,
|
||||
|
||||
Reference in New Issue
Block a user