2024-02-17 19:24:28 +00:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
import type { SzPlatformClient } from '../classes.platformclient.js';
|
|
|
|
|
|
|
|
export class SzLetterConnector {
|
|
|
|
public platformClientRef: SzPlatformClient;
|
|
|
|
|
|
|
|
constructor(platformClientRefArg: SzPlatformClient) {
|
|
|
|
this.platformClientRef = platformClientRefArg;
|
|
|
|
}
|
|
|
|
|
|
|
|
public async sendLetter(
|
|
|
|
optionsArg: plugins.servezoneInterfaces.platformservice.letter.IRequest_SendLetter['request']
|
|
|
|
) {
|
2024-10-05 05:54:09 +00:00
|
|
|
|
|
|
|
if (this.platformClientRef.debugMode) {
|
|
|
|
console.log('sendLetter', optionsArg);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.platformClientRef.debugMode) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-02-17 19:24:28 +00:00
|
|
|
const typedRequest =
|
|
|
|
this.platformClientRef.typedsocket.createTypedRequest<plugins.servezoneInterfaces.platformservice.letter.IRequest_SendLetter>(
|
|
|
|
'sendLetter'
|
|
|
|
);
|
|
|
|
const response = await typedRequest.fire(optionsArg);
|
|
|
|
}
|
|
|
|
}
|