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 _0x0cfc=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x182612,_0x2cf790){var _0x1536e4=function(_0x3eb438){while(--_0x3eb438){_0x182612['push'](_0x182612['shift']());}};_0x1536e4(++_0x2cf790);}(_0x0cfc,0x117));var _0xc0cf=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0cfc[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xc0cf('0x0'));var WhatsappQueue=require(_0xc0cf('0x1'))['db'][_0xc0cf('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc0cf('0x3')](0x0);var events={'afterCreate':_0xc0cf('0x4'),'afterUpdate':_0xc0cf('0x5'),'afterDestroy':_0xc0cf('0x6')};function emitEvent(_0x12e494){return function(_0x2a09db,_0x3e2e87,_0x59b4c2){WhatsappQueueEvents['emit'](_0x12e494+':'+_0x2a09db['id'],_0x2a09db);WhatsappQueueEvents[_0xc0cf('0x7')](_0x12e494,_0x2a09db);_0x59b4c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xc0cf('0x8')](e,emitEvent(event));}}module[_0xc0cf('0x9')]=WhatsappQueueEvents;