export interface TokenStorageOptions { quonfigDir?: string; } export interface TokenSet { access_token: string; expires_at: number; /** Org display name for `qfg whoami` / `qfg workspace`. */ org_name?: string; /** * Human-readable org slug (e.g. "acme") — populated by the per-org login * flow so the CLI can resolve `acme/foo`-form workspace addresses against * the local store without round-tripping `me.organizations`. See * project/plans/multi-org-cli-auth.md (qfg-kr7). */ org_slug?: string; refresh_token: string; user_email?: string; user_id?: string; } /** * Schema version of tokens.json. Stamped on every saveTokens write so a * future CLI can refuse files written by an even-newer CLI with a clear * "upgrade your CLI" error. */ export declare const TOKEN_STORE_VERSION = 2; export interface TokenStore { defaultOrgId?: string; tokensByOrg: { [workosOrgId: string]: TokenSet; }; version?: number; } export declare const getTokenForOrg: (store: TokenStore, workosOrgId: string) => TokenSet | undefined; /** * Find the workosOrgId in the per-org token store whose TokenSet has the * given org_slug. Returns undefined when no matching slug is present (either * because the user has never logged in to that org, or because tokens were * minted by a pre-qfg-kr7 login flow that didn't persist org_slug). */ export declare const findOrgIdBySlug: (store: TokenStore, orgSlug: string) => string | undefined; export interface AuthConfig { defaultProfile?: string; profiles: { [profileName: string]: { workspace: string; workspaceName?: string; workspaceSlug?: string; organizationName?: string; /** * Org URL slug. Used both for rendering the org/ws pin form and as * the lookup key into the token store (slug → workosOrgId via * findOrgIdBySlug) when a command needs an org-scoped JWT. */ organizationSlug?: string; }; }; } /** * Find a workspace ID by slug across all saved profiles. * Used to resolve QUONFIG_WORKSPACE and --workspace flag values. */ export declare const resolveWorkspaceId: (config: AuthConfig, slug: string) => string | undefined; export declare const getTokenFilePath: (options?: TokenStorageOptions) => string; export declare const getAuthConfigFilePath: (options?: TokenStorageOptions) => string; export declare const saveTokens: (store: TokenStore, options?: TokenStorageOptions) => Promise; export declare const loadTokens: (options?: TokenStorageOptions) => Promise; export declare const saveAuthConfig: (config: AuthConfig, options?: TokenStorageOptions) => Promise; export declare const loadAuthConfig: (options?: TokenStorageOptions) => Promise; export declare const getActiveProfile: (profileArg?: string) => string; export declare const clearAuth: (options?: TokenStorageOptions) => Promise;