Full documentation
install:
npm i @plasma-platform/service-notifications -S
- NotificationsService
object with class service messages
Type: object
Subscription - Get system centrifugo token based on resource id
-
params
Object
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
Subscription - Get user token
-
timestamp
number UNIX Timestamp (required)
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
Notification - Add new notification
-
params
Object
(async () => {
const service = new NotificationsService(url, token);
const response = await service.addNewNotification(params);
})();
Returns Promise<Object> Promise object
Notification - Delete notification by property
-
params
Object
(async () => {
const service = new NotificationsService(url, token);
const response = await service.deleteNotificationByProperty(params);
})();
Returns Promise<Object> Promise object
Notification - Delete notification
-
id
string Notification unique ID (required)
(async () => {
const service = new NotificationsService(url, token);
const response = await service.deleteNotification(params);
})();
Returns Promise<Object> Promise object
Notification - Events listener endpoint
-
params
Object
(async () => {
const service = new NotificationsService(url, token);
const response = await service.eventsListenerEndpoint(params);
})();
Returns Promise<Object> Promise object
Notification - Get Allowed methods for Notification API
(async () => {
const service = new NotificationsService(url);
const response = await service.getAllowedMethodsForNotification();
})();
Returns Promise<Object> Promise object
Notification - Get list of notifications
-
params
Object
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getListOfNotifications(params);
})();
Returns Promise<Object> Promise object
Notification - Get pagination headers
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getPaginationHeaders(params);
})();
Returns Promise<Object> Promise object
Notification - Modify notification
-
params
Object
(async () => {
const service = new NotificationsService(url, token);
const response = await service.modifyNotification(params);
})();
Returns Promise<Object> Promise object
Notification - View single notification
-
id
string Notification unique ID (required)
(async () => {
const service = new NotificationsService(url, token);
const response = await service.viewSingleNotification(id);
})();