f4d1cea8436de5fc874433e9023291163fa4b591
[motion2.git] / server / api / voiceQueue / voiceQueue.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x6d4a=['remove','emit','exports','events','../../mysqldb','VoiceQueue','save'];(function(_0x4f6377,_0x348124){var _0x276428=function(_0x45b4b6){while(--_0x45b4b6){_0x4f6377['push'](_0x4f6377['shift']());}};_0x276428(++_0x348124);}(_0x6d4a,0x10d));var _0xa6d4=function(_0x462ea7,_0x37869a){_0x462ea7=_0x462ea7-0x0;var _0x4abbc1=_0x6d4a[_0x462ea7];return _0x4abbc1;};'use strict';var EventEmitter=require(_0xa6d4('0x0'));var VoiceQueue=require(_0xa6d4('0x1'))['db'][_0xa6d4('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa6d4('0x3'),'afterUpdate':'update','afterDestroy':_0xa6d4('0x4')};function emitEvent(_0xed4b03){return function(_0x3a7972,_0x307216,_0x20a824){VoiceQueueEvents[_0xa6d4('0x5')](_0xed4b03+':'+_0x3a7972['id'],_0x3a7972);VoiceQueueEvents['emit'](_0xed4b03,_0x3a7972);_0x20a824(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xa6d4('0x6')]=VoiceQueueEvents;