UNPKG

magicbell

Version:
131 lines 4.61 kB
"use strict"; // This file is generated. Do not update manually! Object.defineProperty(exports, "__esModule", { value: true }); exports.Notifications = void 0; const resource_js_1 = require("../client/resource.js"); class Notifications extends resource_js_1.Resource { path = 'notifications'; entity = 'notification'; /** * Mark a user notification as archived. * * @param notificationId - ID of the user notification. * The ID of a user notification can be obtained from the "Fetch user * notifications" API endpoint or from push events sent to the MagicBell React * library. * * @param options - override client request options. **/ archive(notificationId, options) { return this.request({ method: 'POST', path: '{notification_id}/archive', }, notificationId, options); } markAllRead(dataOrOptions, options) { return this.request({ method: 'POST', path: 'read', }, dataOrOptions, options); } markAllSeen(dataOrOptions, options) { return this.request({ method: 'POST', path: 'seen', }, dataOrOptions, options); } /** * Mark a user notification as read. The notification will be automatically marked * as seen, too. * * The new state will be reflected in the user's notification inbox in real-time. * * @param notificationId - ID of the user notification. * The ID of a user notification can be obtained from the "Fetch user * notifications" API endpoint or from push events sent to the MagicBell React * library. * * @param options - override client request options. **/ markAsRead(notificationId, options) { return this.request({ method: 'POST', path: '{notification_id}/read', }, notificationId, options); } /** * Mark a user notification as unread. The new state will be reflected in the * user's notification inbox in real-time. * * @param notificationId - ID of the user notification. * The ID of a user notification can be obtained from the "Fetch user * notifications" API endpoint or from push events sent to the MagicBell React * library. * * @param options - override client request options. **/ markAsUnread(notificationId, options) { return this.request({ method: 'POST', path: '{notification_id}/unread', }, notificationId, options); } list(dataOrOptions, options) { return this.request({ method: 'GET', paged: true, }, dataOrOptions, options); } /** * Fetch a user's notification by its ID. * * @param notificationId - ID of the user notification. * The ID of a user notification can be obtained from the "Fetch user * notifications" API endpoint or from push events sent to the MagicBell React * library. * * @param options - override client request options. * @returns **/ get(notificationId, options) { return this.request({ method: 'GET', path: '{notification_id}', }, notificationId, options); } /** * Delete a user's notification by its ID. The notification is deleted immediately * and removed from the user's notification inbox in real-time. * * @param notificationId - ID of the user notification. * The ID of a user notification can be obtained from the "Fetch user * notifications" API endpoint or from push events sent to the MagicBell React * library. * * @param options - override client request options. **/ delete(notificationId, options) { return this.request({ method: 'DELETE', path: '{notification_id}', }, notificationId, options); } /** * Mark a user notification as unarchived. * * @param notificationId - ID of the user notification. * The ID of a user notification can be obtained from the "Fetch user * notifications" API endpoint or from push events sent to the MagicBell React * library. * * @param options - override client request options. **/ unarchive(notificationId, options) { return this.request({ method: 'DELETE', path: '{notification_id}/archive', }, notificationId, options); } } exports.Notifications = Notifications; //# sourceMappingURL=notifications.js.map