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 _0xba25=['hook','events','../../mysqldb','VoiceQueue','update','remove','emit'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xba25,0x182));var _0x5ba2=function(_0x389427,_0x5c3a03){_0x389427=_0x389427-0x0;var _0x5527bd=_0xba25[_0x389427];return _0x5527bd;};'use strict';var EventEmitter=require(_0x5ba2('0x0'));var VoiceQueue=require(_0x5ba2('0x1'))['db'][_0x5ba2('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5ba2('0x3'),'afterDestroy':_0x5ba2('0x4')};function emitEvent(_0x359842){return function(_0x17ee29,_0x3042ab,_0x2dd024){VoiceQueueEvents['emit'](_0x359842+':'+_0x17ee29['id'],_0x17ee29);VoiceQueueEvents[_0x5ba2('0x5')](_0x359842,_0x17ee29);_0x2dd024(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x5ba2('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;