import type { SzPlatformClient } from '../classes.platformclient.js'; import * as plugins from '../plugins.js'; export class SzPushNotificationConnector { public platformClientRef: SzPlatformClient; constructor(platformClientRefArg: SzPlatformClient) { this.platformClientRef = platformClientRefArg; } public async sendPushNotification( optionsArg: plugins.servezoneInterfaces.platformservice.pushnotification.IRequest_SendPushNotification['request'] ) { if (this.platformClientRef.debugMode) { console.log('sendPushNotification', optionsArg); } if (this.platformClientRef.debugMode) { return; } const typedRequest = this.platformClientRef.typedsocket.createTypedRequest( 'sendPushNotification' ); const response = await typedRequest.fire(optionsArg); if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) { console.log('sendPushNotification response', response); } return response.status; } }