728df7d3a07a96b4f1675b10a794817023ff9342
[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 _0x57f9=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x1fe6fc,_0x214940){var _0x51fd82=function(_0x879a60){while(--_0x879a60){_0x1fe6fc['push'](_0x1fe6fc['shift']());}};_0x51fd82(++_0x214940);}(_0x57f9,0x10c));var _0x957f=function(_0x540b37,_0x3c7417){_0x540b37=_0x540b37-0x0;var _0x12ad90=_0x57f9[_0x540b37];return _0x12ad90;};'use strict';var EventEmitter=require(_0x957f('0x0'));var VoiceQueue=require(_0x957f('0x1'))['db'][_0x957f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x957f('0x3')](0x0);var events={'afterCreate':_0x957f('0x4'),'afterUpdate':_0x957f('0x5'),'afterDestroy':_0x957f('0x6')};function emitEvent(_0x1abf6f){return function(_0x166697,_0xa74db9,_0xdb2ad1){VoiceQueueEvents[_0x957f('0x7')](_0x1abf6f+':'+_0x166697['id'],_0x166697);VoiceQueueEvents[_0x957f('0x7')](_0x1abf6f,_0x166697);_0xdb2ad1(null);};}for(var e in events){if(events[_0x957f('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;