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 _0xd6e6=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x353a99,_0x14908a){var _0x4868b4=function(_0x4e4107){while(--_0x4e4107){_0x353a99['push'](_0x353a99['shift']());}};_0x4868b4(++_0x14908a);}(_0xd6e6,0x6e));var _0x6d6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6e6[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x6d6e('0x0'));var UserVoiceQueueRt=require(_0x6d6e('0x1'))['db'][_0x6d6e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6d6e('0x3')](0x0);var events={'afterCreate':_0x6d6e('0x4'),'afterUpdate':_0x6d6e('0x5'),'afterDestroy':_0x6d6e('0x6')};function emitEvent(_0x4c30c7){return function(_0x283653,_0x15bfd4,_0x3d58b1){UserVoiceQueueRtEvents['emit'](_0x4c30c7+':'+_0x283653['id'],_0x283653);UserVoiceQueueRtEvents[_0x6d6e('0x7')](_0x4c30c7,_0x283653);_0x3d58b1(null);};}for(var e in events){if(events[_0x6d6e('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0x6d6e('0x9')](e,emitEvent(event));}}module[_0x6d6e('0xa')]=UserVoiceQueueRtEvents;