Skip to main content

Class: MattermostClient

@pvm/mattermost.MattermostClient

Hierarchy

Constructors

constructor

• new MattermostClient(name, config, clientConfig?)

Parameters

NameType
namestring
configConfig
clientConfigMessengerClientConfig

Inherited from

AbstractMessengerClient.constructor

Defined in

packages/pvm-notifications/lib/abstract-messenger-client.ts:8

Properties

clientConfig

• Protected clientConfig: MessengerClientConfig = {}

Inherited from

AbstractMessengerClient.clientConfig


config

• Protected config: Config

Inherited from

AbstractMessengerClient.config


name

• name: string

Inherited from

AbstractMessengerClient.name

Methods

createDirectChannel

â–¸ createDirectChannel(userName): Promise<string>

Parameters

NameType
userNamestring

Returns

Promise<string>

Defined in

packages/pvm-mattermost/lib/index.ts:74


getChannelIdFromChannelName

â–¸ getChannelIdFromChannelName(channelName): Promise<null | string>

Parameters

NameType
channelNamestring

Returns

Promise<null | string>

Defined in

packages/pvm-mattermost/lib/index.ts:52


getMessageWithDefaults

â–¸ getMessageWithDefaults(message): Message

Parameters

NameType
messageMessage

Returns

Message

Inherited from

AbstractMessengerClient.getMessageWithDefaults

Defined in

packages/pvm-notifications/lib/abstract-messenger-client.ts:11


getSelfId

â–¸ getSelfId(): Promise<null | string>

Returns

Promise<null | string>

Defined in

packages/pvm-mattermost/lib/index.ts:24


getUserIdFromUserName

â–¸ getUserIdFromUserName(userName): Promise<string>

Parameters

NameType
userNamestring

Returns

Promise<string>

Defined in

packages/pvm-mattermost/lib/index.ts:38


internalSendMessage

â–¸ Protected internalSendMessage(message): Promise<void>

Internal method for sending messages. Message here already populated with all sorts of defaults.

Channel and content here are mandatory. This is checked in AbstractMessengerClient.sendMessage

Parameters

NameType
messageMessage & { channel: string ; content: string }

Returns

Promise<void>

Overrides

AbstractMessengerClient.internalSendMessage

Defined in

packages/pvm-mattermost/lib/index.ts:102


isReady

â–¸ isReady(): boolean

Returns

boolean

Overrides

AbstractMessengerClient.isReady

Defined in

packages/pvm-mattermost/lib/index.ts:13


requestApi

â–¸ requestApi(__namedParameters): Promise<any>

Parameters

NameType
__namedParametersObject
__namedParameters.body?Record<string, any>
__namedParameters.method"GET" | "POST"
__namedParameters.pathstring

Returns

Promise<any>

Defined in

packages/pvm-mattermost/lib/index.ts:133


requestWithRetries

â–¸ requestWithRetries(requestFn): Promise<any>

Parameters

NameType
requestFn() => Promise<any>

Returns

Promise<any>

Defined in

packages/pvm-mattermost/lib/index.ts:149


sendMessage

â–¸ sendMessage(message): Promise<void>

Parameters

NameType
messageMessage

Returns

Promise<void>

Inherited from

AbstractMessengerClient.sendMessage

Defined in

packages/pvm-notifications/lib/abstract-messenger-client.ts:22