Built motion from commit 639a1a7f.|2.6.19
[motion2.git] / server / api / voiceExtension / voiceExtension.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 _0xbad5=['VoiceExtension','setMaxListeners','update','emit','hasOwnProperty','events'];(function(_0x1697b5,_0x9c02f3){var _0x5894e3=function(_0x43466b){while(--_0x43466b){_0x1697b5['push'](_0x1697b5['shift']());}};_0x5894e3(++_0x9c02f3);}(_0xbad5,0x1a9));var _0x5bad=function(_0x55f5e0,_0x4c0d32){_0x55f5e0=_0x55f5e0-0x0;var _0x51f3d5=_0xbad5[_0x55f5e0];return _0x51f3d5;};'use strict';var EventEmitter=require(_0x5bad('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x5bad('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x5bad('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5bad('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6be1){return function(_0x210c5d,_0x581fb3,_0x312264){VoiceExtensionEvents[_0x5bad('0x4')](_0x2f6be1+':'+_0x210c5d['id'],_0x210c5d);VoiceExtensionEvents[_0x5bad('0x4')](_0x2f6be1,_0x210c5d);_0x312264(null);};}for(var e in events){if(events[_0x5bad('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;