P8-ExchangeService/modules/parus_alice.js

34 lines
956 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Сервис интеграции ПП Парус 8 с WEB API
Дополнительный модуль: Взаимодействие с Яндекс-Диалогами (голосовым помошником "Алиса")
*/
//------------
// Тело модуля
//------------
//ДО функции "Алиса/Начало сеанса"
const beforeLogin = async prms => {
const d = `${prms.queue.blMsg.toString()} BEFORE LOGIN`;
return {
blMsg: new Buffer(d)
};
};
//ПОСЛЕ функции "Алиса/Начало сеанса"
const afterLogin = async prms => {
let d = "";
if (prms.queue.blResp) d = `${prms.queue.blResp.toString()} AFTER LOGIN`;
else d = `${prms.queue.blMsg.toString()} AFTER LOGIN`;
return {
blResp: new Buffer(d)
};
};
//-----------------
// Интерфейс модуля
//-----------------
exports.beforeLogin = beforeLogin;
exports.afterLogin = afterLogin;