@sudoplatform/sudo-secure-communications
    Preparing search index...

    Interface ChannelsModule

    Channel management for the Secure Communications Service.

    interface ChannelsModule {
        acceptInvitation(input: AcceptChannelInvitationInput): Promise<void>;
        acceptInvitationRequest(input: AcceptInvitationRequestInput): Promise<void>;
        banHandle(input: BanChannelHandleInput): Promise<void>;
        createChannel(input: CreateChannelInput): Promise<Channel>;
        declineInvitation(input: DeclineChannelInvitationInput): Promise<void>;
        declineInvitationRequest(
            input: DeclineInvitationRequestInput,
        ): Promise<void>;
        deleteChannel(input: DeleteChannelInput): Promise<void>;
        getChannel(input: GetChannelInput): Promise<Channel | undefined>;
        getChannelMembers(input: GetChannelMembersInput): Promise<ChannelMember[]>;
        getChannelMembership(
            input: GetChannelMembershipInput,
        ): Promise<MembershipState | undefined>;
        getChannels(input: GetChannelsInput): Promise<Channel[]>;
        joinChannel(input: JoinChannelInput): Promise<void>;
        kickHandle(input: KickChannelHandleInput): Promise<void>;
        leaveChannel(input: LeaveChannelInput): Promise<void>;
        listInvitations(handleId: HandleId): Promise<Channel[]>;
        listJoined(handleId: HandleId): Promise<Channel[]>;
        listReceivedInvitationRequests(
            input: ListReceivedInvitationRequestsInput,
        ): Promise<ChannelInvitationRequest[]>;
        listSentInvitationRequests(handleId: HandleId): Promise<Channel[]>;
        searchPublicChannels(
            input: PublicChannelSearchInput,
        ): Promise<ListOutput<PublicChannelSearchResult>>;
        sendInvitationRequest(input: SendInvitationRequestInput): Promise<void>;
        sendInvitations(input: SendChannelInvitationsInput): Promise<void>;
        unbanHandle(input: UnbanChannelHandleInput): Promise<void>;
        updateChannel(input: UpdateChannelInput): Promise<Channel>;
        updateChannelMemberRole(input: UpdateChannelMemberRoleInput): Promise<void>;
        withdrawInvitation(input: WithdrawChannelInvitationInput): Promise<void>;
        withdrawInvitationRequest(
            input: WithdrawInvitationRequestInput,
        ): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Accepts an invitation to join a channel.

      Parameters

      Returns Promise<void>

    • Accept an invitation request to join a channel.

      Parameters

      Returns Promise<void>

    • Bans a handle from a channel. Must have a higher role than the target handle to perform this action.

      Parameters

      Returns Promise<void>

    • Create a new channel.

      Invites handles to the newly created channel if a list of handle identifiers are supplied in the input.

      Parameters

      Returns Promise<Channel>

      The newly created channel.

    • Decline an invitaton request to join a channel. Must have a higher role than the target handle to perform this action.

      Parameters

      Returns Promise<void>

    • Delete an existing channel.

      Note: The channel needs to be private before deleting due to technical constraints.

      Note: The handle has to have a higher power level than everyone else in the channel in order to delete it for others. This usually means that only the host of a channel can delete it.

      Parameters

      Returns Promise<void>

    • Retrieve an individual channel by the channel's identifier.

      Parameters

      Returns Promise<Channel | undefined>

      The channel matching the input identifier, or undefined if not found.

    • Retrieves a list of all members of a channel that the current handle is a member of.

      Parameters

      Returns Promise<ChannelMember[]>

      The list of channel members in the channel.

    • Get the state of membership of the current handle in the channel.

      Note: When a handle is not actively in the channel (status is either MembershipState.LEFT or MembershipState.BANNED), they will not receive membership state updates. This means the handle cannot observe transitions between MembershipState.LEFT and MembershipState.BANNED states. For consistent state management, it's recommended to treat both these states as "not in channel" rather than distinguishing between them.

      Parameters

      Returns Promise<MembershipState | undefined>

      The membership state of the handle in the channel, or undefined if unknown. Undefined usually means the handle has never intereacted with the channel which is equivalent to MembershipState.LEFT.

    • Batch retrieve channels with a list of channel identifiers.

      Parameters

      Returns Promise<Channel[]>

      List of channels matching the supplied identifiers, less any identifiers that did not correspond to a channel.

    • Add this handle to an existing channel by identifier. Only public channels can be joined without an invitation.

      Parameters

      Returns Promise<void>

    • Kicks a handle from a channel. Must have a higher role than the target handle to perform this action. Can kick yourself.

      Parameters

      Returns Promise<void>

    • Remove this handle from a specified channel by identifier.

      Parameters

      Returns Promise<void>

    • Retrieve a list of all channels the handle has an active invitation for.

      Parameters

      • handleId: HandleId

        Identifier of the handle owned by this client.

      Returns Promise<Channel[]>

      A list of channels this handle has been invited to.

    • Retrieve a list of all channels the handle is included in as a member.

      Parameters

      • handleId: HandleId

        Identifier of the handle owned by this client.

      Returns Promise<Channel[]>

      A list of channels containing all of the handle's joined channels.

    • Retrieve all channels this handle has sent an invitation request for.

      Parameters

      • handleId: HandleId

        Identifier of the handle owned by this client.

      Returns Promise<Channel[]>

      A list of channels the handle has requested an invite to.

    • Send an invitation request to join a channel.

      Parameters

      Returns Promise<void>

    • Invite handles to join an existing channel.

      Parameters

      Returns Promise<void>

    • Unbans a handle from a channel. Must have a higher role than the target handle to perform this action.

      Parameters

      Returns Promise<void>

    • Update the editable fields of a channel.

      Parameters

      Returns Promise<Channel>

      The updated channel.

    • Updates the channel role for a specific member of a channel. Must have a higher role than the target handle to perform this action. Can downgrade your own role.

      Parameters

      Returns Promise<void>

    • Withdraw a previously sent channel invitation. Must have a higher role than the target handle to perform this action.

      Parameters

      Returns Promise<void>

    • Withdraw a previously sent channel invitation request.

      Parameters

      Returns Promise<void>