d2f3ce4ea0f0ce4474539b1b1064ecc9669e86e6
[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 _0xfef6=['emit','hasOwnProperty','events','setMaxListeners','save','update','remove'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xfef6,0xb1));var _0x6fef=function(_0x4a16a8,_0x387b52){_0x4a16a8=_0x4a16a8-0x0;var _0x2f7311=_0xfef6[_0x4a16a8];return _0x2f7311;};'use strict';var EventEmitter=require(_0x6fef('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6fef('0x1')](0x0);var events={'afterCreate':_0x6fef('0x2'),'afterUpdate':_0x6fef('0x3'),'afterDestroy':_0x6fef('0x4')};function emitEvent(_0x3aa336){return function(_0x1cf71d,_0x2cbd9c,_0x59c5fc){VoiceQueueEvents['emit'](_0x3aa336+':'+_0x1cf71d['id'],_0x1cf71d);VoiceQueueEvents[_0x6fef('0x5')](_0x3aa336,_0x1cf71d);_0x59c5fc(null);};}for(var e in events){if(events[_0x6fef('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;