118ee971382e7b0b395d5c6133ff43ae49066a9a
[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 _0x97e6=['hook','exports','../../mysqldb','setMaxListeners','save','remove'];(function(_0x376dd3,_0x10edb9){var _0x2c449b=function(_0x8660ba){while(--_0x8660ba){_0x376dd3['push'](_0x376dd3['shift']());}};_0x2c449b(++_0x10edb9);}(_0x97e6,0xce));var _0x697e=function(_0x11afd1,_0x4d62ff){_0x11afd1=_0x11afd1-0x0;var _0x5e8b34=_0x97e6[_0x11afd1];return _0x5e8b34;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x697e('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x697e('0x1')](0x0);var events={'afterCreate':_0x697e('0x2'),'afterUpdate':'update','afterDestroy':_0x697e('0x3')};function emitEvent(_0x4ff73c){return function(_0x15bf8b,_0x59bba3,_0x261412){VoiceQueueEvents['emit'](_0x4ff73c+':'+_0x15bf8b['id'],_0x15bf8b);VoiceQueueEvents['emit'](_0x4ff73c,_0x15bf8b);_0x261412(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x697e('0x4')](e,emitEvent(event));}}module[_0x697e('0x5')]=VoiceQueueEvents;