@lark-project/cli
Version:
飞书项目插件开发工具
19 lines (18 loc) • 807 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.whoamiService = void 0;
const auth_config_1 = require("../../utils/auth-config");
const select_1 = require("./select");
const format_1 = require("./format");
/**
* `lpm whoami` — report logged-in Meego sites and suggest one for `lpm create`.
* Read-only; prints a self-describing report to stdout and always exits 0
* ("not logged in" is conveyed by the text, not an error code).
* Never prints tokens: only origins + login dates flow through selectDomains.
*/
async function whoamiService() {
const store = (0, auth_config_1.loadStore)();
const selection = (0, select_1.selectDomains)(store);
process.stdout.write((0, format_1.formatWhoami)(selection) + '\n');
}
exports.whoamiService = whoamiService;