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 _0x226a=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x226a,0xb5));var _0xa226=function(_0x5eca50,_0xc1e3f8){_0x5eca50=_0x5eca50-0x0;var _0x41fb84=_0x226a[_0x5eca50];return _0x41fb84;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xa226('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa226('0x1')](0x0);var events={'afterCreate':_0xa226('0x2'),'afterUpdate':_0xa226('0x3'),'afterDestroy':_0xa226('0x4')};function emitEvent(_0x5eb59a){return function(_0x2cf0fd,_0x5a675b,_0x4c97de){WhatsappQueueEvents['emit'](_0x5eb59a+':'+_0x2cf0fd['id'],_0x2cf0fd);WhatsappQueueEvents[_0xa226('0x5')](_0x5eb59a,_0x2cf0fd);_0x4c97de(null);};}for(var e in events){if(events[_0xa226('0x6')](e)){var event=events[e];WhatsappQueue[_0xa226('0x7')](e,emitEvent(event));}}module[_0xa226('0x8')]=WhatsappQueueEvents;