@prismshadow/penguin-library-messaging · library/messaging/src/messaging.ts:8

MessagingBindings

interface

MessagingBindings: the mechanism MessagingBindingsRepo implements.

API

@Interface()
export abstract class MessagingBindings {
  abstract find(sessionId: string, channel: string): MessagingBindingRow | null;
  abstract findEnabled(sessionId: string): MessagingBindingRow | null;
  abstract listForSession(sessionId: string): MessagingBindingRow[];
  abstract findEnabledByAccount(channel: string, accountId: string): MessagingBindingRow | null;
  abstract listAll(): MessagingBindingRow[];
  abstract upsert(args: {
      sessionId: string;
      channel: string;
      accountId: string;
      config: Record<string, unknown>;
      linePerMessage?: boolean;
      finalReplyOnly?: boolean;
      renderMarkdown?: boolean;
    }): MessagingBindingRow;
  abstract setEnabled(sessionId: string, channel: string, enabled: boolean): void;
  abstract recordChat(sessionId: string, channel: string, chatId: string, isDirect: boolean): void;
  abstract recordInboundWatermark(
      sessionId: string,
      channel: string,
      messageId: string | null,
    ): void;
  abstract delete(sessionId: string, channel: string): void;
  abstract deleteSession(sessionId: string): void;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use

Members (11)

find

find(sessionId: string, channel: string): MessagingBindingRow | null
@paramsessionIdstring
@paramchannelstring
@returnsMessagingBindingRow | null

findEnabled

findEnabled(sessionId: string): MessagingBindingRow | null
@paramsessionIdstring
@returnsMessagingBindingRow | null

listForSession

listForSession(sessionId: string): MessagingBindingRow[]
@paramsessionIdstring
@returnsMessagingBindingRow[]

findEnabledByAccount

findEnabledByAccount(channel: string, accountId: string): MessagingBindingRow | null
@paramchannelstring
@paramaccountIdstring
@returnsMessagingBindingRow | null

listAll

listAll(): MessagingBindingRow[]
@returnsMessagingBindingRow[]

upsert

upsert(args: { sessionId: string; channel: string; accountId: string; config: Record<string, unknown>; linePerMessage?: boolean; finalReplyOnly?: boolean; renderMarkdown?: boolean; }): MessagingBindingRow
@paramargs{ sessionId: string; channel: string; accountId: string; config: Record<string, unknown>; linePerMessage?: boolean; finalReplyOnly?: boolean; renderMarkdown?: boolean; }
@returnsMessagingBindingRow

setEnabled

setEnabled(sessionId: string, channel: string, enabled: boolean): void
@paramsessionIdstring
@paramchannelstring
@paramenabledboolean
@returnsvoid

recordChat

recordChat(sessionId: string, channel: string, chatId: string, isDirect: boolean): void
@paramsessionIdstring
@paramchannelstring
@paramchatIdstring
@paramisDirectboolean
@returnsvoid

recordInboundWatermark

recordInboundWatermark(sessionId: string, channel: string, messageId: string | null): void
@paramsessionIdstring
@paramchannelstring
@parammessageIdstring | null
@returnsvoid

delete

delete(sessionId: string, channel: string): void
@paramsessionIdstring
@paramchannelstring
@returnsvoid

deleteSession

deleteSession(sessionId: string): void
@paramsessionIdstring
@returnsvoid