import type { TokenRefreshMiddleware } from "./token-refresh-middleware.js"; export interface ControlApiOptions { accessToken: string; controlHost?: string; logErrors?: boolean; tokenRefreshMiddleware?: TokenRefreshMiddleware; } export interface App { accountId: string; apnsAuthType?: "certificate" | "token" | null; apnsCertificate?: string | null; apnsCertificateConfigured?: boolean; apnsIssuerKey?: string | null; apnsPrivateKey?: string | null; apnsSigningKey?: string | null; apnsSigningKeyConfigured?: boolean; apnsSigningKeyId?: string | null; apnsTopicHeader?: string | null; apnsUseSandboxEndpoint?: boolean | null; apnsUsesSandboxCert?: boolean; created: number; fcmProjectId?: string | null; fcmServiceAccount?: string | null; fcmServiceAccountConfigured?: boolean; id: string; modified: number; name: string; status: string; tlsOnly: boolean; [key: string]: unknown; } export interface AppStats { appId?: string; entries: { [key: string]: number; }; intervalId: string; schema?: string; unit: string; } export type AccountStats = AppStats; export interface Key { appId: string; capability: unknown; created: number; id: string; key: string; modified: number; name: string; revocable: boolean; status: string; } export interface Namespace { appId: string; authenticated?: boolean; batchingEnabled?: boolean; batchingInterval?: number | null; conflationEnabled?: boolean; conflationInterval?: number | null; conflationKey?: string; created: number; exposeTimeSerial?: boolean; id: string; modified: number; mutableMessages?: boolean; persistLast?: boolean; persisted: boolean; populateChannelRegistry?: boolean; pushEnabled: boolean; tlsOnly?: boolean; } export interface Rule { _links?: { self: string; }; appId: string; created: number; id: string; modified: number; requestMode: string; ruleType: string; source: { channelFilter: string; type: string; }; target: unknown; version: string; } export interface RuleData { requestMode: string; ruleType: string; source: { channelFilter: string; type: string; }; status?: "disabled" | "enabled"; target: Record; } export interface RuleUpdateData { requestMode?: string; ruleType?: string; source?: Partial<{ channelFilter: string; type: string; }>; status?: "disabled" | "enabled"; target?: Partial>; } export interface Queue { amqp: { queueName: string; uri: string; }; appId: string; deadletter: boolean; deadletterId: string; id: string; maxLength: number; messages: { ready: number; total: number; unacknowledged: number; }; name: string; region: string; state: string; stats: { acknowledgementRate: null | number; deliveryRate: null | number; publishRate: null | number; }; stomp: { destination: string; host: string; uri: string; }; ttl: number; } export interface HelpResponse { answer: string; links: { breadcrumbs: string[]; description: null | string; label: string; title: string; type: string; url: string; }[]; } export interface Conversation { messages: { content: string; role: "assistant" | "user"; }[]; } export interface MeResponse { account: { id: string; name: string; }; user: { email: string; }; } export interface AccountSummary { id: string; name: string; } export declare class ControlApi { private accessToken; private controlHost; private logErrors; private tokenRefreshMiddleware?; constructor(options: ControlApiOptions); askHelp(question: string, conversation?: Conversation): Promise; createApp(appData: { name: string; tlsOnly?: boolean; }): Promise; createKey(appId: string, keyData: { capability?: Record; name: string; }): Promise; createNamespace(appId: string, namespaceData: { authenticated?: boolean; batchingEnabled?: boolean; batchingInterval?: number; id: string; conflationEnabled?: boolean; conflationInterval?: number; conflationKey?: string; exposeTimeSerial?: boolean; mutableMessages?: boolean; persistLast?: boolean; persisted?: boolean; populateChannelRegistry?: boolean; pushEnabled?: boolean; tlsOnly?: boolean; }): Promise; createQueue(appId: string, queueData: { maxLength?: number; name: string; region?: string; ttl?: number; }): Promise; createRule(appId: string, ruleData: RuleData): Promise; deleteApp(appId: string): Promise; deleteNamespace(appId: string, namespaceId: string): Promise; deleteQueue(appId: string, queueId: string): Promise; deleteRule(appId: string, ruleId: string): Promise; getAccountStats(options?: { by?: string; end?: number; limit?: number; start?: number; unit?: string; }): Promise; getApp(appId: string): Promise; getAppStats(appId: string, options?: { by?: string; end?: number; limit?: number; start?: number; unit?: string; }): Promise; getKey(appId: string, keyIdentifier: string): Promise; getAccounts(): Promise; getMe(): Promise; getNamespace(appId: string, namespaceId: string): Promise; getRule(appId: string, ruleId: string): Promise; listApps(): Promise; listKeys(appId: string): Promise; listNamespaces(appId: string): Promise; listQueues(appId: string): Promise; listRules(appId: string): Promise; revokeKey(appId: string, keyId: string): Promise; updateApp(appId: string, appData: Partial): Promise; updateKey(appId: string, keyId: string, keyData: { capability?: Record; name?: string; }): Promise; updateNamespace(appId: string, namespaceId: string, namespaceData: { authenticated?: boolean; batchingEnabled?: boolean; batchingInterval?: number; conflationEnabled?: boolean; conflationInterval?: number; conflationKey?: string; exposeTimeSerial?: boolean; mutableMessages?: boolean; persistLast?: boolean; persisted?: boolean; populateChannelRegistry?: boolean; pushEnabled?: boolean; tlsOnly?: boolean; }): Promise; updateRule(appId: string, ruleId: string, ruleData: RuleUpdateData): Promise; uploadApnsP12(appId: string, certificateData: Buffer | string, options?: { password?: string; useForSandbox?: boolean; }): Promise; private request; }