Built motion from commit ddca4d0d.|2.5.47
[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 _0x15ff=['hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit'];(function(_0x232890,_0x32ae31){var _0xdbb42b=function(_0x5e17de){while(--_0x5e17de){_0x232890['push'](_0x232890['shift']());}};_0xdbb42b(++_0x32ae31);}(_0x15ff,0x14f));var _0xf15f=function(_0x38dba6,_0x1b4e6f){_0x38dba6=_0x38dba6-0x0;var _0x53c1a5=_0x15ff[_0x38dba6];return _0x53c1a5;};'use strict';var EventEmitter=require(_0xf15f('0x0'));var VoiceExtension=require(_0xf15f('0x1'))['db'][_0xf15f('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf15f('0x3')](0x0);var events={'afterCreate':_0xf15f('0x4'),'afterUpdate':'update','afterDestroy':_0xf15f('0x5')};function emitEvent(_0x1e2f11){return function(_0x1113e3,_0x475034,_0x585719){VoiceExtensionEvents[_0xf15f('0x6')](_0x1e2f11+':'+_0x1113e3['id'],_0x1113e3);VoiceExtensionEvents[_0xf15f('0x6')](_0x1e2f11,_0x1113e3);_0x585719(null);};}for(var e in events){if(events[_0xf15f('0x7')](e)){var event=events[e];VoiceExtension[_0xf15f('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;