Skip to content

Class: NotificationEndpoint ​

Defined in: endpoints/notification.ts:37

Constructors ​

Constructor ​

ts
new NotificationEndpoint(client): NotificationEndpoint;

Defined in: endpoints/notification.ts:38

Parameters ​

ParameterType
clientRESTClient

Returns ​

NotificationEndpoint

Methods ​

getDevices() ​

ts
getDevices(): Promise<IPushDevicesResponse>;

Defined in: endpoints/notification.ts:45

Returns ​

Promise<IPushDevicesResponse>


getMentions() ​

ts
getMentions(options?): Promise<IMentionFeedResponse>;

Defined in: endpoints/notification.ts:97

Recent messages that mention the current user, newest first, in channels they can still see. Pass the last one's message id as before for more.

Parameters ​

ParameterType
options?{ before?: number; limit?: number; }
options.before?number
options.limit?number

Returns ​

Promise<IMentionFeedResponse>


getSettings() ​

ts
getSettings(): Promise<INotificationSettingsResponse>;

Defined in: endpoints/notification.ts:82

every server and channel notification setting away from its default

Returns ​

Promise<INotificationSettingsResponse>


registerDevice() ​

ts
registerDevice(registration): Promise<IPushDeviceResponse>;

Defined in: endpoints/notification.ts:41

Register this installation, replacing its previous token or account binding.

Parameters ​

ParameterType
registrationIPushDeviceRegistration

Returns ​

Promise<IPushDeviceResponse>


signOutDevice() ​

ts
signOutDevice(deviceId): Promise<IApiResponse>;

Defined in: endpoints/notification.ts:73

Sign out the phone's whole sign-in, as for a lost phone. It stops getting pushes at once.

Parameters ​

ParameterType
deviceIdstring

Returns ​

Promise<IApiResponse>


testDevice() ​

ts
testDevice(deviceId): Promise<IPushDeviceTestResponse>;

Defined in: endpoints/notification.ts:64

Send the device a test notification through the relay.

Parameters ​

ParameterType
deviceIdstring

Returns ​

Promise<IPushDeviceTestResponse>


unregisterDevice() ​

ts
unregisterDevice(deviceId): Promise<IApiResponse>;

Defined in: endpoints/notification.ts:50

Idempotent and scoped to the authenticated owner. A phone still signed in registers again when it is next opened.

Parameters ​

ParameterType
deviceIdstring

Returns ​

Promise<IApiResponse>


updateChannelSetting() ​

ts
updateChannelSetting(channelId, changes): Promise<IChannelNotificationSettingResponse>;

Defined in: endpoints/notification.ts:105

Parameters ​

ParameterType
channelIdnumber
changesIChannelNotificationUpdate

Returns ​

Promise<IChannelNotificationSettingResponse>


updateDevice() ​

ts
updateDevice(deviceId, changes): Promise<IPushDeviceResponse>;

Defined in: endpoints/notification.ts:57

Switch a device's pushes off or on. Off survives the phone registering again.

Parameters ​

ParameterType
deviceIdstring
changesIPushDeviceUpdate

Returns ​

Promise<IPushDeviceResponse>


updateServerSetting() ​

ts
updateServerSetting(serverId, changes): Promise<IServerNotificationSettingResponse>;

Defined in: endpoints/notification.ts:86

Parameters ​

ParameterType
serverIdnumber
changesIServerNotificationUpdate

Returns ​

Promise<IServerNotificationSettingResponse>

Released under the GNU Affero General Public License v3.0.