Files
openclaw/src/pairing/pairing-store-sqlite.test-helpers.ts
T
Peter Steinberger e2ec8283c4 refactor(deadcode): trim mid-size src exports (#105888)
* refactor(deadcode): trim auto-reply and CLI exports

* refactor(deadcode): trim cron and task exports

* refactor(deadcode): trim fleet and process exports

* test(deadcode): exercise live task and process seams

* test(fleet): cover stream redaction through owner module

* refactor(security): trim dead internal exports

* refactor(secrets): trim dead internal exports

* refactor(deadcode): trim remaining src exports

* refactor(deadcode): remove test-only runtime exports

* refactor(deadcode): trim pairing test exports

* refactor(deadcode): reconcile refreshed baseline

* test(auto-reply): deduplicate queue state imports
2026-07-13 00:42:56 -07:00

28 lines
854 B
TypeScript

import { runOpenClawStateWriteTransaction } from "../state/openclaw-state-db.js";
import {
readChannelPairingState,
sqliteOptionsForEnv,
writeChannelPairingStateToDatabase,
} from "./pairing-store-sqlite.js";
import type { PairingChannel } from "./pairing-store.types.js";
type ChannelPairingState = ReturnType<typeof readChannelPairingState>;
export function readChannelPairingStateSnapshot(
channel: PairingChannel,
env: NodeJS.ProcessEnv = process.env,
): ChannelPairingState {
return readChannelPairingState(channel, env);
}
export function writeChannelPairingStateSnapshot(
channel: PairingChannel,
state: ChannelPairingState,
env: NodeJS.ProcessEnv = process.env,
): void {
runOpenClawStateWriteTransaction(
(database) => writeChannelPairingStateToDatabase(database, channel, state),
sqliteOptionsForEnv(env),
);
}