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 _0x6e45=['WhatsappQueue','setMaxListeners','save','update','remove','events','../../mysqldb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6e45,0x140));var _0x56e4=function(_0x150214,_0x3767a7){_0x150214=_0x150214-0x0;var _0x27f83d=_0x6e45[_0x150214];return _0x27f83d;};'use strict';var EventEmitter=require(_0x56e4('0x0'));var WhatsappQueue=require(_0x56e4('0x1'))['db'][_0x56e4('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x56e4('0x3')](0x0);var events={'afterCreate':_0x56e4('0x4'),'afterUpdate':_0x56e4('0x5'),'afterDestroy':_0x56e4('0x6')};function emitEvent(_0x24b7fb){return function(_0x1dc33a,_0x1d4c7e,_0x51f01a){WhatsappQueueEvents['emit'](_0x24b7fb+':'+_0x1dc33a['id'],_0x1dc33a);WhatsappQueueEvents['emit'](_0x24b7fb,_0x1dc33a);_0x51f01a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;