fix(core): Update dependencies and add logging for email and SMS functions
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/platformclient',
|
||||
version: '1.0.6',
|
||||
version: '1.0.7',
|
||||
description: 'a module that makes it really easy to use the serve.zone platform inside your app'
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
import type { SzPlatformClient } from '../classes.platformclient.js';
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
import { logger } from '../logger.js';
|
||||
|
||||
export class SzEmailConnector {
|
||||
public platformClientRef: SzPlatformClient;
|
||||
|
||||
@ -16,6 +18,15 @@ export class SzEmailConnector {
|
||||
'sendEmail'
|
||||
);
|
||||
const response = await typedRequest.fire(optionsArg);
|
||||
|
||||
if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) {
|
||||
logger.log('info', `sent email with subject ${optionsArg.title} to ${optionsArg.to}
|
||||
body:
|
||||
${optionsArg.body.split('\n').map(line => ` ${line}`).join('\n')}
|
||||
|
||||
`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public async sendNotification(optionsArg: { toArg: string; subject: string; text: string }) {}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type { SzPlatformClient } from '../classes.platformclient.js';
|
||||
import { logger } from '../logger.js';
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
export class SzSmsConnector {
|
||||
@ -13,6 +14,16 @@ export class SzSmsConnector {
|
||||
'sendSms'
|
||||
);
|
||||
const response = await typedrequest.fire(messageArg);
|
||||
|
||||
if (process.env.SERVEZONE_PLATFORMCLIENT_DEBUG) {
|
||||
logger.log('info', `sent sms to ${messageArg.toNumber}}
|
||||
body:
|
||||
${messageArg.messageText.split('\n').map(line => ` ${line}`).join('\n')}
|
||||
|
||||
`);
|
||||
}
|
||||
|
||||
|
||||
return response.status;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1 @@
|
||||
export * from './classes.platformclient.js';
|
||||
|
||||
// Things for building a server
|
||||
import { servertools, utilityservers } from '@api.global/typedserver';
|
||||
|
||||
|
||||
|
@ -6,4 +6,6 @@ export const logger = new plugins.smartlog.Smartlog({
|
||||
runtime: 'node',
|
||||
zone: 'serve.zone',
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
logger.enableConsole();
|
@ -8,12 +8,10 @@ export {
|
||||
// @push.rocks scope
|
||||
import * as qenv from '@push.rocks/qenv';
|
||||
import * as smartlog from '@push.rocks/smartlog';
|
||||
import * as smartntml from '@push.rocks/smartntml';
|
||||
|
||||
export {
|
||||
qenv,
|
||||
smartlog,
|
||||
smartntml,
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user