@plasma-platform/service-notifications
v2.0.0
Published
Service Notifications Api
Downloads
75
Readme
Full documentation
install:npm i @plasma-platform/service-notifications -S
Short documentation
Table of Contents
- NotificationsService
NotificationsService
messages
object with class service messages
Type: object
getResourceToken
Subscription - Get system centrifugo token based on resource id
Parameters
params
Object
Examples
Get membership plan info by ID
(async () => {
const service = new NotificationsService(url);
const response = await service.getResourceToken(params);
})();
Returns Promise<Object> Promise object represents info
getUserToken
Subscription - Get user token
Parameters
timestamp
number UNIX Timestamp (required)
Examples
Get membership plan info by ID
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getUserToken(timestamp);
})();
Returns Promise<Object> Promise object represents info
addNewNotification
Notification - Add new notification
Parameters
params
Object
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.addNewNotification(params);
})();
Returns Promise<Object> Promise object
deleteNotificationByProperty
Notification - Delete notification by property
Parameters
params
Object
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.deleteNotificationByProperty(params);
})();
Returns Promise<Object> Promise object
deleteNotification
Notification - Delete notification
Parameters
id
string Notification unique ID (required)
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.deleteNotification(params);
})();
Returns Promise<Object> Promise object
eventsListenerEndpoint
Notification - Events listener endpoint
Parameters
params
Object
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.eventsListenerEndpoint(params);
})();
Returns Promise<Object> Promise object
getAllowedMethodsForNotification
Notification - Get Allowed methods for Notification API
Examples
(async () => {
const service = new NotificationsService(url);
const response = await service.getAllowedMethodsForNotification();
})();
Returns Promise<Object> Promise object
getListOfNotifications
Notification - Get list of notifications
Parameters
params
Object
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getListOfNotifications(params);
})();
Returns Promise<Object> Promise object
getPaginationHeaders
Notification - Get pagination headers
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getPaginationHeaders(params);
})();
Returns Promise<Object> Promise object
modifyNotification
Notification - Modify notification
Parameters
params
Object
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.modifyNotification(params);
})();
Returns Promise<Object> Promise object
viewSingleNotification
Notification - View single notification
Parameters
id
string Notification unique ID (required)
Examples
(async () => {
const service = new NotificationsService(url, token);
const response = await service.viewSingleNotification(id);
})();