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 _0x4eb9=['../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4eb9,0x185));var _0x94eb=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x4eb9[_0x278e3c];return _0x3e2d9b;};'use strict';var EventEmitter=require(_0x94eb('0x0'));var WhatsappQueue=require(_0x94eb('0x1'))['db'][_0x94eb('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x94eb('0x3')](0x0);var events={'afterCreate':_0x94eb('0x4'),'afterUpdate':'update','afterDestroy':_0x94eb('0x5')};function emitEvent(_0x3db077){return function(_0x384eba,_0x4cfca7,_0x2af656){WhatsappQueueEvents[_0x94eb('0x6')](_0x3db077+':'+_0x384eba['id'],_0x384eba);WhatsappQueueEvents[_0x94eb('0x6')](_0x3db077,_0x384eba);_0x2af656(null);};}for(var e in events){if(events[_0x94eb('0x7')](e)){var event=events[e];WhatsappQueue[_0x94eb('0x8')](e,emitEvent(event));}}module[_0x94eb('0x9')]=WhatsappQueueEvents;