2a7c7903b11be66bdbd4cda87d1c5ca2893eda7e
[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 _0xfc44=['VoiceExtension','save','remove','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5ec62e,_0x1a717b){var _0xe5416f=function(_0x38af18){while(--_0x38af18){_0x5ec62e['push'](_0x5ec62e['shift']());}};_0xe5416f(++_0x1a717b);}(_0xfc44,0x15c));var _0x4fc4=function(_0x3de690,_0x4ed3ed){_0x3de690=_0x3de690-0x0;var _0x88d098=_0xfc44[_0x3de690];return _0x88d098;};'use strict';var EventEmitter=require(_0x4fc4('0x0'));var VoiceExtension=require(_0x4fc4('0x1'))['db'][_0x4fc4('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4fc4('0x3'),'afterUpdate':'update','afterDestroy':_0x4fc4('0x4')};function emitEvent(_0x36ef4c){return function(_0x29387a,_0x12d1f0,_0x163491){VoiceExtensionEvents['emit'](_0x36ef4c+':'+_0x29387a['id'],_0x29387a);VoiceExtensionEvents['emit'](_0x36ef4c,_0x29387a);_0x163491(null);};}for(var e in events){if(events[_0x4fc4('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x4fc4('0x6')]=VoiceExtensionEvents;