@plasma-platform/service-notifications

2.0.0 • Public • Published

version nextVersion downloads license dependency


Full documentation
install:
npm i @plasma-platform/service-notifications -S

Short documentation

Table of Contents

NotificationsService

messages

object with class service messages

Type: object

getResourceToken

Subscription - Get system centrifugo token based on resource id

Parameters

  • params Object
    • params.resourceId string Resource ID (orderId for example) (required)
    • params.timestamp number UNIX Timestamp (required)
    • params.prefix string prefix for centrifuge

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
    • params.user_id string ID of the user for whom notification have been created (required)
    • params.content string Notification html code (required)
    • params.subject string Notification subject (required)
    • params.params string JSON object with parameters of notification (type, etc.) (required)

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
    • params.propertyName string Notification param property name (required)
    • params.propertyValue string Notification param property value (required)

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
    • params.user_id string ID of the user for whom notification have been created (required)
    • params.event string Event name (required)

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
    • params.perPage string Number of notifications per one page (optional)
    • params.page string Page number (optional)
    • params.is_viewed string 0: find not viewed notifications, 1: find viewed notifications. Allowed values: 0, 1 (optional)

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
    • params.id string Notification unique ID (required)
    • params.viewed_at string Time when notification was viewed (required)

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);
})();

Returns Promise<Object> Promise object

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.07latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.07
1.5.01
1.4.171
1.4.161
1.4.151
1.4.141
1.4.15-alpha.01
1.4.14-alpha.01
1.4.131
1.4.13-alpha.01
1.4.12-alpha.01
1.4.111
1.4.101
1.4.91
1.4.9-alpha.01
1.4.8-alpha.01
1.4.71
1.4.61
1.4.51
1.6.0-alpha.01
1.4.41
1.4.31
1.4.21
1.4.11
1.4.01
1.2.21
1.4.0-alpha.01
1.3.0-alpha.01
1.2.11
1.2.01
1.1.101
1.1.91
1.1.81
1.1.71
1.1.61
1.1.51
1.1.41
1.1.31
1.1.21
1.1.11
1.1.01
1.0.122
1.0.111
1.0.101
1.0.91
1.0.81
1.0.71
1.0.61
1.0.51
1.0.41
1.0.31

Package Sidebar

Install

npm i @plasma-platform/service-notifications

Weekly Downloads

58

Version

2.0.0

License

CC-BY-4.0

Unpacked Size

67.5 kB

Total Files

6

Last publish

Collaborators

  • alienmonster
  • ch-tm
  • viram