mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 03:00:42 +00:00
25 lines
733 B
TypeScript
25 lines
733 B
TypeScript
import fs from "node:fs";
|
|
import { saveJsonFile } from "../../infra/json-file.js";
|
|
import { AUTH_STORE_VERSION } from "./constants.js";
|
|
import { resolveAuthStatePath, resolveAuthStorePath } from "./path-resolve.js";
|
|
import type { AuthProfileSecretsStore } from "./types.js";
|
|
export {
|
|
resolveAuthStatePath,
|
|
resolveAuthStatePathForDisplay,
|
|
resolveAuthStorePath,
|
|
resolveAuthStorePathForDisplay,
|
|
resolveLegacyAuthStorePath,
|
|
resolveOAuthRefreshLockPath,
|
|
} from "./path-resolve.js";
|
|
|
|
export function ensureAuthStoreFile(pathname: string) {
|
|
if (fs.existsSync(pathname)) {
|
|
return;
|
|
}
|
|
const payload: AuthProfileSecretsStore = {
|
|
version: AUTH_STORE_VERSION,
|
|
profiles: {},
|
|
};
|
|
saveJsonFile(pathname, payload);
|
|
}
|