import type * as lark from '@larksuiteoapi/node-sdk'; import type { TransportDiagnostics } from './diagnostics.js'; /** * Who this app is, as Feishu reports it. * * Both lookups run at startup with the same bounded retry, and both degrade to * a diagnostic rather than failing the transport: without the bot open_id, * mention-gated groups drop every message, and without the app owner the * channel simply cannot run owner-only flows. * * Bot identity additionally stays recoverable after a failed startup: only a * non-empty `open_id` is cached, so `createSelfIdentityCache` can retry ahead * of the next inbound chat message. */ export declare const FEISHU_APP_OWNER_TYPE_ENTERPRISE_MEMBER = 2; /** * Raw identity of the app creator / owner, returned by * `GET /open-apis/application/v6/applications/{appId}` with * `user_id_type=open_id`. */ export interface FeishuAppOwnerIdentity { creatorOpenId?: string; ownerOpenId?: string; ownerType?: number; } export interface FeishuBotInfo { openId?: string; appName?: string | undefined; } export declare function resolveBotInfo(client: lark.Client, diag: TransportDiagnostics): Promise; /** * Process-local self identity for the running app. * * Only a lookup that returned a non-empty `open_id` is cached; a failed or * empty lookup is not an answer, so identity stays unresolved and the next * inbound chat message retries it. Concurrent messages share the one in-flight * lookup. There is no negative cache, timer, background loop, or persisted * state — the cache holds a success or nothing. */ export interface FeishuSelfIdentityCache { /** The cached identity, or `undefined` while it is still unresolved. */ readonly resolved: FeishuBotInfo | undefined; /** Resolve while unresolved, sharing one in-flight bot-info lookup. */ ensureResolved(): Promise; } export declare function createSelfIdentityCache(client: lark.Client, diag: TransportDiagnostics): FeishuSelfIdentityCache; export declare function resolveAppOwner(client: lark.Client, diag: TransportDiagnostics, appId: string): Promise; //# sourceMappingURL=identity.d.ts.map