1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0xcdfb=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x5cd708,_0x203410){var _0x7ed8ec=function(_0x2e4998){while(--_0x2e4998){_0x5cd708['push'](_0x5cd708['shift']());}};_0x7ed8ec(++_0x203410);}(_0xcdfb,0x1c3));var _0xbcdf=function(_0x47231e,_0x14cd1e){_0x47231e=_0x47231e-0x0;var _0x1c8fcc=_0xcdfb[_0x47231e];return _0x1c8fcc;};'use strict';var EventEmitter=require(_0xbcdf('0x0'));var WhatsappQueue=require(_0xbcdf('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xbcdf('0x2')](0x0);var events={'afterCreate':_0xbcdf('0x3'),'afterUpdate':'update','afterDestroy':_0xbcdf('0x4')};function emitEvent(_0x41d079){return function(_0x3a939c,_0x71464d,_0x1704f3){WhatsappQueueEvents['emit'](_0x41d079+':'+_0x3a939c['id'],_0x3a939c);WhatsappQueueEvents[_0xbcdf('0x5')](_0x41d079,_0x3a939c);_0x1704f3(null);};}for(var e in events){if(events[_0xbcdf('0x6')](e)){var event=events[e];WhatsappQueue[_0xbcdf('0x7')](e,emitEvent(event));}}module[_0xbcdf('0x8')]=WhatsappQueueEvents;