UNPKG

@stratosphere-network/wallet

Version:

Wallet module for StratoSphere SDK

79 lines 2.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NotificationService = void 0; const base_service_1 = require("../base-service"); class NotificationService extends base_service_1.BaseService { /** * Register or update a notification subscription for the current user */ async registerSubscription(request) { return this.authenticatedRequest({ method: "POST", url: "/notifications/register", data: { subscriberId: request.subscriberId, deviceInfo: request.deviceInfo, platform: request.platform, }, }); } /** * Unsubscribe from notifications */ async unsubscribe(subscriberId) { return this.authenticatedRequest({ method: "POST", url: "/notifications/unsubscribe", data: { subscriberId }, }); } /** * Get all notification subscriptions for the current user */ async getUserSubscriptions() { return this.authenticatedRequest({ method: "GET", url: "/notifications/subscriptions", }); } /** * Send a test notification to a specific subscriber */ async sendTestNotification(request) { return this.authenticatedRequest({ method: "POST", url: "/notifications/test", data: { subscriberId: request.subscriberId, message: request.message, targetUrl: request.targetUrl, title: request.title, }, }); } /** * Send notification to all subscribers of the current user */ async sendToAllUserSubscribers(request) { return this.authenticatedRequest({ method: "POST", url: "/notifications/send", data: { message: request.message, targetUrl: request.targetUrl, title: request.title, }, }); } /** * Delete all notification subscriptions for the current user */ async deleteAllSubscriptions() { return this.authenticatedRequest({ method: "DELETE", url: "/notifications/subscriptions", }); } } exports.NotificationService = NotificationService; //# sourceMappingURL=notifications.js.map