c84defa410b8a7d3b627075506736ba3d81df252
[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 _0x1a5a=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3a292a,_0x1c8369){var _0x1335b9=function(_0x409abc){while(--_0x409abc){_0x3a292a['push'](_0x3a292a['shift']());}};_0x1335b9(++_0x1c8369);}(_0x1a5a,0x1d5));var _0xa1a5=function(_0x1dec41,_0x4f0520){_0x1dec41=_0x1dec41-0x0;var _0x294655=_0x1a5a[_0x1dec41];return _0x294655;};'use strict';var EventEmitter=require(_0xa1a5('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xa1a5('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xa1a5('0x2')](0x0);var events={'afterCreate':_0xa1a5('0x3'),'afterUpdate':_0xa1a5('0x4'),'afterDestroy':_0xa1a5('0x5')};function emitEvent(_0x967721){return function(_0x55965c,_0x1ea424,_0x437dda){VoiceExtensionEvents[_0xa1a5('0x6')](_0x967721+':'+_0x55965c['id'],_0x55965c);VoiceExtensionEvents['emit'](_0x967721,_0x55965c);_0x437dda(null);};}for(var e in events){if(events[_0xa1a5('0x7')](e)){var event=events[e];VoiceExtension[_0xa1a5('0x8')](e,emitEvent(event));}}module[_0xa1a5('0x9')]=VoiceExtensionEvents;