Interface Channel

Enables messages to be published and historic messages to be retrieved for a channel.

Hierarchy

  • Channel

Properties

annotations: RestAnnotations
name: string

The channel name.

presence: Presence

A Presence object.

push: PushChannel

A PushChannel object.

Methods

  • Marks a message as deleted by publishing an update with an action of MESSAGE_DELETE. This does not remove the message from the server, and the full message history remains accessible. Uses patch semantics: non-null name, data, and extras fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged (meaning that if you for example want the MESSAGE_DELETE to have an empty data, you should explicitly set the data to an empty object).

    Parameters

    • message: Message

      A Message object containing a populated serial field.

    • Optional operation: MessageOperation

      An optional MessageOperation object containing metadata about the delete operation.

    • Optional params: Record<string, any>

      Optional parameters sent as part of the query string.

    Returns Promise<Message>

    A promise which, upon success, will be fulfilled with a Message object containing the deleted message. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.

  • Retrieves the latest version of a specific message by its serial identifier.

    Parameters

    • serialOrMessage: string | Message

      Either the serial identifier string of the message to retrieve, or a Message object containing a populated serial field.

    Returns Promise<Message>

    A promise which, upon success, will be fulfilled with a Message object representing the latest version of the message. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.

  • Retrieves all historical versions of a specific message, ordered by version. This includes the original message and all subsequent updates or delete operations.

    Parameters

    • serialOrMessage: string | Message

      Either the serial identifier string of the message whose versions are to be retrieved, or a Message object containing a populated serial field.

    • Optional params: Record<string, any>

      Optional parameters sent as part of the query string.

    Returns Promise<PaginatedResult<Message>>

    A promise which, upon success, will be fulfilled with a PaginatedResult object containing an array of Message objects representing all versions of the message. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.

  • Retrieves a PaginatedResult object, containing an array of historical InboundMessage objects for the channel. If the channel is configured to persist messages, then messages can be retrieved from history for up to 72 hours in the past. If not, messages can only be retrieved from history for up to two minutes in the past.

    Parameters

    • Optional params: RestHistoryParams

      A set of parameters which are used to specify which messages should be retrieved.

    Returns Promise<PaginatedResult<InboundMessage>>

    A promise which, upon success, will be fulfilled with a PaginatedResult object containing an array of InboundMessage objects. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.

  • Publishes an array of messages to the channel.

    Parameters

    Returns Promise<void>

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

  • Publishes a message to the channel.

    Parameters

    Returns Promise<void>

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

  • Publishes a single message to the channel with the given event name and payload.

    Parameters

    • name: string

      The name of the message.

    • data: any

      The payload of the message.

    • Optional options: PublishOptions

      Optional parameters, such as quickAck sent as part of the query string.

    Returns Promise<void>

    A promise which resolves upon success of the operation and rejects with an ErrorInfo object upon its failure.

  • Publishes an update to an existing message with patch semantics. Non-null name, data, and extras fields in the provided message will replace the corresponding fields in the existing message, while null fields will be left unchanged.

    Parameters

    • message: Message

      A Message object containing a populated serial field and the fields to update.

    • Optional operation: MessageOperation

      An optional MessageOperation object containing metadata about the update operation.

    • Optional params: Record<string, any>

      Optional parameters sent as part of the query string.

    Returns Promise<Message>

    A promise which, upon success, will be fulfilled with a Message object containing the updated message. Upon failure, the promise will be rejected with an ErrorInfo object which explains the error.

Generated using TypeDoc