53b5b33790c671b87b87428bd191b09384629a41
[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 _0x60ac=['hook','exports','../../mysqldb','VoiceExtension','setMaxListeners','update','emit','hasOwnProperty'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x60ac,0x162));var _0xc60a=function(_0x104aa9,_0x373cfe){_0x104aa9=_0x104aa9-0x0;var _0x10b91a=_0x60ac[_0x104aa9];return _0x10b91a;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xc60a('0x0'))['db'][_0xc60a('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc60a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc60a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x31516d){return function(_0x1d4cb4,_0x589c40,_0x86a24c){VoiceExtensionEvents[_0xc60a('0x4')](_0x31516d+':'+_0x1d4cb4['id'],_0x1d4cb4);VoiceExtensionEvents[_0xc60a('0x4')](_0x31516d,_0x1d4cb4);_0x86a24c(null);};}for(var e in events){if(events[_0xc60a('0x5')](e)){var event=events[e];VoiceExtension[_0xc60a('0x6')](e,emitEvent(event));}}module[_0xc60a('0x7')]=VoiceExtensionEvents;