Built motion from commit da617fac.|2.6.6
[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 _0x3552=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1bd498,_0x14b925){var _0xb4473e=function(_0x367808){while(--_0x367808){_0x1bd498['push'](_0x1bd498['shift']());}};_0xb4473e(++_0x14b925);}(_0x3552,0x81));var _0x2355=function(_0x46dab5,_0x482784){_0x46dab5=_0x46dab5-0x0;var _0x175c4d=_0x3552[_0x46dab5];return _0x175c4d;};'use strict';var EventEmitter=require(_0x2355('0x0'));var VoiceQueue=require(_0x2355('0x1'))['db'][_0x2355('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2355('0x3')](0x0);var events={'afterCreate':_0x2355('0x4'),'afterUpdate':_0x2355('0x5'),'afterDestroy':_0x2355('0x6')};function emitEvent(_0xfe19df){return function(_0x4d41b3,_0xb5680f,_0x103871){VoiceQueueEvents['emit'](_0xfe19df+':'+_0x4d41b3['id'],_0x4d41b3);VoiceQueueEvents[_0x2355('0x7')](_0xfe19df,_0x4d41b3);_0x103871(null);};}for(var e in events){if(events[_0x2355('0x8')](e)){var event=events[e];VoiceQueue[_0x2355('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;