99e22cc7412ea111ea34109709713a0a17570f40
[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 _0x21c3=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x47dcb4,_0x2c395a){var _0x356abb=function(_0x43ac25){while(--_0x43ac25){_0x47dcb4['push'](_0x47dcb4['shift']());}};_0x356abb(++_0x2c395a);}(_0x21c3,0x71));var _0x321c=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x21c3[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0x321c('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x321c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x321c('0x2'),'afterDestroy':_0x321c('0x3')};function emitEvent(_0xc4e401){return function(_0x200844,_0x30085f,_0x42e2aa){VoiceQueueEvents[_0x321c('0x4')](_0xc4e401+':'+_0x200844['id'],_0x200844);VoiceQueueEvents[_0x321c('0x4')](_0xc4e401,_0x200844);_0x42e2aa(null);};}for(var e in events){if(events[_0x321c('0x5')](e)){var event=events[e];VoiceQueue[_0x321c('0x6')](e,emitEvent(event));}}module[_0x321c('0x7')]=VoiceQueueEvents;