Home Reference Source
import Notification from '~/models/Notification.js'
public class | source

Notification

Implements:

Represents a notification

Static Method Summary

Static Public Methods
public static
public static

async getStatuses(): Enum

This returns an enumeration of notification statuses

public static

async getTypes(): Enum

This returns an enumeration of notification types

Constructor Summary

Public Constructor
public

A notification

Member Summary

Public Members
public get

Gets the body

public get

Obtains the category

public get

The notification creationdate

public get

The notification UUID

public get

Returns past participle of the notification

public get

Returns the plural of the notification.

public get

The notification recipient

public get

Obtains responder URL

public get

The notification sender

public get

The source ID.

public get
public set

Sets the status of this notification

public get

The target ID

public get

Method Summary

Public Methods
public

async getIconURL(): string

Obtains Icon URL

public

async getPayload(): T

Obtains the payload of the notification if possible.

public

Gets the title

Static Public Methods

public static fromJSON(json: Object): Notification source

Params:

NameTypeAttributeDescription
json Object

Return:

Notification

public static async getStatuses(): Enum source

This returns an enumeration of notification statuses

Return:

Enum

of the NotificationStatus enumeration

public static async getTypes(): Enum source

This returns an enumeration of notification types

Return:

Enum

of the NotificationType enumeration

Public Constructors

public constructor() source

A notification

Params:

NameTypeAttributeDescription
options.id string

Notification UUID

options.title string

Title of ntoif

options.body string

Body of notif

options.recipient User

Delivery user

options.sender User

User who sent

options.target number

The ID of the target which triggered the notif

options.source number

the ID of the source which caused the context for recieving the notification

options.category string

The category based on a string for responder

options.dateCreated Date

The date created

options.plural string

Plural form of type

options.type NotificationType

the notification type

options.status NotificationStatus

Read status

Public Members

public get body: string source

Gets the body

public get category: NotificationCategory source

Obtains the category

public get dateCreated: Date source

The notification creationdate

public get id: string source

The notification UUID

public get pastParticiple source

Returns past participle of the notification

public get plural source

Returns the plural of the notification.

public get recipient: User source

The notification recipient

public get responder: string source

Obtains responder URL

public get sender: User source

The notification sender

public get source: number source

The source ID. This is the post that resulted in the notification subscription. For example in "A new answer to your post". This would be the Post ID.

public get status source

public set status: NotificationStatus source

Sets the status of this notification

public get target: number source

The target ID

public get type source

Public Methods

public async getIconURL(): string source

Obtains Icon URL

Return:

string

public async getPayload(): T source

Obtains the payload of the notification if possible.

Return:

T

type depends on the notification

public getTitle(): string source

Gets the title