c8785e17548d8d260fa2ac9a0b10b7495964d106
[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 _0x98cb=['setMaxListeners','update','remove','emit','hook','events','VoiceQueue'];(function(_0x158df0,_0x3b5e6c){var _0x5af4c1=function(_0x537074){while(--_0x537074){_0x158df0['push'](_0x158df0['shift']());}};_0x5af4c1(++_0x3b5e6c);}(_0x98cb,0x8a));var _0xb98c=function(_0xe68bb7,_0x16c6c7){_0xe68bb7=_0xe68bb7-0x0;var _0x254b6f=_0x98cb[_0xe68bb7];return _0x254b6f;};'use strict';var EventEmitter=require(_0xb98c('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xb98c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb98c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb98c('0x3'),'afterDestroy':_0xb98c('0x4')};function emitEvent(_0x21be33){return function(_0x5a6c20,_0x5aed3e,_0x3dd0fd){VoiceQueueEvents['emit'](_0x21be33+':'+_0x5a6c20['id'],_0x5a6c20);VoiceQueueEvents[_0xb98c('0x5')](_0x21be33,_0x5a6c20);_0x3dd0fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xb98c('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;