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 _0x802a=['WhatsappQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x155b34,_0x5d5f34){var _0x1cabe4=function(_0x4f6b26){while(--_0x4f6b26){_0x155b34['push'](_0x155b34['shift']());}};_0x1cabe4(++_0x5d5f34);}(_0x802a,0x9f));var _0xa802=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x802a[_0x59d89e];return _0x554e93;};'use strict';var EventEmitter=require(_0xa802('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xa802('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa802('0x2'),'afterUpdate':_0xa802('0x3'),'afterDestroy':_0xa802('0x4')};function emitEvent(_0x37a3f1){return function(_0x35e8de,_0x5d1c12,_0x3b8b89){WhatsappQueueEvents[_0xa802('0x5')](_0x37a3f1+':'+_0x35e8de['id'],_0x35e8de);WhatsappQueueEvents[_0xa802('0x5')](_0x37a3f1,_0x35e8de);_0x3b8b89(null);};}for(var e in events){if(events[_0xa802('0x6')](e)){var event=events[e];WhatsappQueue[_0xa802('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;