Nurama Developers
Namespaces

notification

Methods and types of the `notification` namespace (`client.notification` / `bot.notification`).

Interfaces

BaseNotificationParams

Extended by

Properties

PropertyType
channelsstring[]
types?string[]

ChannelQuery

Properties

PropertyType
channelsstring[]
types?string[]

GetNewNotificationCountBulkData

Properties

PropertyType
channelQueriesChannelQuery[]

GetNewNotificationCountData

Extends

Properties

PropertyTypeInherited from
channelsstring[]BaseNotificationParams.channels
types?string[]BaseNotificationParams.types

GetNewNotificationsData

Extends

Properties

PropertyTypeInherited from
channelsstring[]BaseNotificationParams.channels
cursor?stringPaginationParams.cursor
includeCounts?booleanPaginationParams.includeCounts
includeCursorRecord?booleanPaginationParams.includeCursorRecord
includeStartAtRecord?booleanPaginationParams.includeStartAtRecord
limit?numberPaginationParams.limit
page?numberPaginationParams.page
paginate?"cursor" | "index"-
paginateReverse?booleanPaginationParams.paginateReverse
startAt?stringPaginationParams.startAt
types?string[]BaseNotificationParams.types
updateLastSeen?boolean-

GetNotificationsData

Extends

Properties

PropertyTypeInherited from
channelsstring[]BaseNotificationParams.channels
createdAfter?number-
createdBefore?number-
cursor?stringPaginationParams.cursor
includeCounts?booleanPaginationParams.includeCounts
includeCursorRecord?booleanPaginationParams.includeCursorRecord
includeStartAtRecord?booleanPaginationParams.includeStartAtRecord
limit?numberPaginationParams.limit
page?numberPaginationParams.page
paginate?"cursor" | "index"-
paginateReverse?booleanPaginationParams.paginateReverse
sort?Record<string, -1 | 1>SortParams.sort
startAt?stringPaginationParams.startAt
types?string[]BaseNotificationParams.types

GetUsersLastNotificationsSeenData

Extends

Properties

PropertyTypeInherited from
channelsstring[]BaseNotificationParams.channels
types?string[]BaseNotificationParams.types

PaginationParams

Extended by

Properties

PropertyType
cursor?string
includeCounts?boolean
includeCursorRecord?boolean
includeStartAtRecord?boolean
limit?number
page?number
paginateReverse?boolean
startAt?string

SortParams

Extended by

Properties

PropertyType
sort?Record<string, -1 | 1>

UpdateUsersLastSeenData

Extends

Properties

PropertyTypeInherited from
channelsstring[]BaseNotificationParams.channels
types?string[]BaseNotificationParams.types

Type Aliases

LastSeenResponse

type LastSeenResponse = {
  channels: string[];
  lastSeen: number;
  types?: string[];
};

Properties

PropertyType
channelsstring[]
lastSeennumber
types?string[]

NotificationCountBulkResponse

type NotificationCountBulkResponse = {
  channels: string[];
  count: number;
  types?: string[];
}[];

Type Declaration

NameType
channelsstring[]
countnumber
types?string[]

NotificationCountResponse

type NotificationCountResponse = {
  count: number;
};

Properties

PropertyType
countnumber

PaginatedNotificationResponse

type PaginatedNotificationResponse = PaginatedResponse<Notification>;

PaginatedResponse

type PaginatedResponse<T> = PaginatedResult | CursorPaginatedResult & {
  results?: T[];
};

Type Declaration

NameType
results?T[]

Type Parameters

Type Parameter
T

Functions

default()

function default(client): {
  getNewNotificationCount: Promise<NotificationCountResponse>;
  getNewNotificationCountBulk: Promise<NotificationCountBulkResponse>;
  getNewNotifications: Promise<PaginatedNotificationResponse>;
  getNotifications: Promise<PaginatedNotificationResponse>;
  getUsersLastNotificationsSeen: Promise<LastSeenResponse>;
  updateUsersLastSeen: Promise<LastSeenResponse>;
};

Defines notification-related methods for the NuramaClient.

Parameters

ParameterTypeDescription
clientdefaultThe NuramaClient instance.

Returns

An object containing the notification-related methods.

NameTypeDescription
getNewNotificationCount()(data) => Promise<NotificationCountResponse>Gets the count of new (unread) notifications for the specified channels.
getNewNotificationCountBulk()(data) => Promise<NotificationCountBulkResponse>Gets the count of new notifications for multiple channel/type queries in a single request.
getNewNotifications()(data) => Promise<PaginatedNotificationResponse>Retrieves new notifications since the user's last viewed timestamp for the specified channels. Optionally updates the last viewed timestamp.
getNotifications()(data) => Promise<PaginatedNotificationResponse>Retrieves notifications for specified channels, with optional filtering and pagination.
getUsersLastNotificationsSeen()(data) => Promise<LastSeenResponse>Retrieves the last seen timestamp record for the specified channels and optional types.
updateUsersLastSeen()(data) => Promise<LastSeenResponse>Updates (or creates) the last seen timestamp for the user for the specified channels and optional types.

On this page