npm

@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.05latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.05
1.5.00
1.4.170
1.4.160
1.4.150
1.4.140
1.4.15-alpha.00
1.4.14-alpha.00
1.4.130
1.4.13-alpha.00
1.4.12-alpha.00
1.4.110
1.4.100
1.4.90
1.4.9-alpha.00
1.4.8-alpha.00
1.4.70
1.4.60
1.4.50
1.6.0-alpha.00
1.4.40
1.4.30
1.4.20
1.4.10
1.4.00
1.2.20
1.4.0-alpha.00
1.3.0-alpha.00
1.2.10
1.2.00
1.1.100
1.1.90
1.1.81
1.1.70
1.1.60
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30

Package Sidebar

Install

npm i @plasma-platform/service-notifications

Weekly Downloads

6

Version

2.0.0

License

CC-BY-4.0

Unpacked Size

67.5 kB

Total Files

6

Last publish

Collaborators

  • alienmonster
  • ch-tm
  • viram