openvibe-sdk/chat-apps

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

From types/chat-apps.d.ts (server only). Declarations are shown verbatim.

type ChatApp

openvibe-sdk/chat-apps: the three chat apps (Telegram, Discord, Slack) — the checks, the buttons and the messages.

export type ChatApp = 'telegram' | 'discord' | 'slack';

interface DeliveryCheck

export interface DeliveryCheck {
    provider: ChatApp | string;
    secret?: string | null;
    publicKey?: string | null;
    raw?: Buffer | string;
    headers?: Record<string, string | string[] | undefined>;
    now?: number;
}

interface CallbackPayload

export interface CallbackPayload {
    exp?: number;
    iat?: number;
    act?: string;
    id?: string;
    app?: ChatApp | string;
    chatId?: string;
    userId?: string;
    subject?: string;
    [k: string]: unknown;
}

interface ChatMessage

export interface ChatMessage {
    app: ChatApp;
    kind: 'message' | 'command' | 'mention' | 'button' | 'ping' | 'unknown';
    chatId: string;
    chatType: 'private' | 'group' | 'channel' | 'unknown';
    userId: string;
    userName: string | null;
    text: string;
    command: string | null;
    args: string;
    mention: boolean;
    replyToBot: boolean;
    attachments: Array<{ kind: string; id?: string; name?: string | null; mime?: string | null; url?: string | null }>;
    button: { id: string; value?: string | null } | null;
    messageId?: string;
    requestId?: string | null;
    threadTs?: string | null;
    raw: unknown;
}

export export function verifyTelegram(args: { secret?: string | nul

export function verifyTelegram(args: { secret?: string | null; headers?: Record<string, any> }): boolean;

export export function verifySlack(args: { secret?: string | null;

export function verifySlack(args: { secret?: string | null; raw?: Buffer | string; headers?: Record<string, any>; now?: number }): boolean;

export export function verifyDiscord(args: { publicKey?: string | n

export function verifyDiscord(args: { publicKey?: string | null; raw?: Buffer | string; headers?: Record<string, any>; now?: number }): boolean;

export export function verifyDelivery(args: DeliveryCheck): boolean

export function verifyDelivery(args: DeliveryCheck): boolean;

export export function signCallback(args: { secret: string; payload

export function signCallback(args: { secret: string; payload: CallbackPayload }): string;

export export function verifyCallback(args: { secret: string; token

export function verifyCallback(args: { secret: string; token: string; now?: number; maxAgeMs?: number }): CallbackPayload | null;

export export function parseTelegramUpdate(update: any, opts?: { bo

export function parseTelegramUpdate(update: any, opts?: { botUsername?: string | null; botUserId?: string | null }): ChatMessage | null;

export export function parseDiscordInteraction(interaction: any, op

export function parseDiscordInteraction(interaction: any, opts?: { botUserId?: string | null }): ChatMessage | null;

export export function parseSlackEvent(event: any, opts?: { botUser

export function parseSlackEvent(event: any, opts?: { botUserId?: string | null }): ChatMessage | null;

export export function parseSlackInteraction(payload: any): ChatMes

export function parseSlackInteraction(payload: any): ChatMessage | null;

export export function splitText(app: ChatApp | string, body: strin

export function splitText(app: ChatApp | string, body: string, limit?: number): string[];

export export function commandOf(body: string): { command: string;

export function commandOf(body: string): { command: string; args: string; mentionName: string | null } | null;

export export function safeEqual(a: unknown, b: unknown): boolean;

export function safeEqual(a: unknown, b: unknown): boolean;

export export const APP_LIMITS: { telegram: number; discord: number

export const APP_LIMITS: { telegram: number; discord: number; slack: number };

export export const PROVIDERS: string[];

export const PROVIDERS: string[];

export export const TOLERANCE_SEC: number;

export const TOLERANCE_SEC: number;

export export function signButton(args: { secret: string; id: strin

export function signButton(args: { secret: string; id: string }): string;

export export function verifyButton(args: { secret: string; token:

export function verifyButton(args: { secret: string; token: string }): string | null;

export export function parseDiscordMessage(message: any, opts?: { b

export function parseDiscordMessage(message: any, opts?: { botUserId?: string | null }): ChatMessage | null;