@lark-project/cli
Version:
飞书项目插件开发工具
20 lines (19 loc) • 802 B
TypeScript
import type { AuthStore } from "../../utils/auth-config";
export interface DomainEntry {
domain: string;
lastUsedAt?: number;
}
export interface WhoamiSelection {
/** Sorted: entries with a timestamp first (newest→oldest), untimed ones last. */
domains: DomainEntry[];
/** Domain to suggest for `lpm create`, or null when it cannot be decided. */
suggested: string | null;
}
/**
* Pick the domain to suggest for `lpm create`, applying the three-tier rule:
* - 0 domains → suggested = null
* - exactly 1 → that domain (uniqueness wins, even with no timestamp)
* - >=2, some timed → newest lastUsedAt
* - >=2, none timed → suggested = null (caller asks the user to pick)
*/
export declare function selectDomains(store: AuthStore): WhoamiSelection;