abc8653bcb93083e7257f4fb4408d81213cfece2
[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 _0x958d=['VoiceQueue','setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x414a78,_0x3fc6d0){var _0xd1afe=function(_0x3e4f91){while(--_0x3e4f91){_0x414a78['push'](_0x414a78['shift']());}};_0xd1afe(++_0x3fc6d0);}(_0x958d,0xde));var _0xd958=function(_0x5c3bbe,_0x9f24e2){_0x5c3bbe=_0x5c3bbe-0x0;var _0x11201c=_0x958d[_0x5c3bbe];return _0x11201c;};'use strict';var EventEmitter=require(_0xd958('0x0'));var VoiceQueue=require(_0xd958('0x1'))['db'][_0xd958('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd958('0x3')](0x0);var events={'afterCreate':_0xd958('0x4'),'afterUpdate':_0xd958('0x5'),'afterDestroy':_0xd958('0x6')};function emitEvent(_0xc83365){return function(_0x39a66a,_0x4bd72e,_0x48d663){VoiceQueueEvents['emit'](_0xc83365+':'+_0x39a66a['id'],_0x39a66a);VoiceQueueEvents[_0xd958('0x7')](_0xc83365,_0x39a66a);_0x48d663(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;