Files
platformclient/ts/email/classes.pushnotificationconnector.ts
T

35 lines
1.0 KiB
TypeScript
Raw Normal View History

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(
2026-04-28 11:30:20 +00:00
optionsArg: plugins.servezoneInterfaces.platform.pushnotification.IReq_SendPushNotification['request']
) {
if (this.platformClientRef.debugMode) {
console.log('sendPushNotification', optionsArg);
}
if (this.platformClientRef.debugMode) {
return;
}
const typedRequest =
2026-04-28 11:30:20 +00:00
this.platformClientRef.typedsocket.createTypedRequest<plugins.servezoneInterfaces.platform.pushnotification.IReq_SendPushNotification>(
'sendPushNotification'
);
const response = await typedRequest.fire(optionsArg);
if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) {
console.log('sendPushNotification response', response);
}
return response.status;
}
2026-04-28 11:30:20 +00:00
}