05b4f43b25c104a91eca466adc5e9579ca21cd40
[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 _0x25b8=['remove','emit','hasOwnProperty','hook','exports','VoiceExtension','setMaxListeners','save','update'];(function(_0x5f4c82,_0x4e0f16){var _0x48ff5b=function(_0x4faecc){while(--_0x4faecc){_0x5f4c82['push'](_0x5f4c82['shift']());}};_0x48ff5b(++_0x4e0f16);}(_0x25b8,0x16d));var _0x825b=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x25b8[_0x2576d7];return _0x16a08c;};'use strict';var EventEmitter=require('events');var VoiceExtension=require('../../mysqldb')['db'][_0x825b('0x0')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x825b('0x1')](0x0);var events={'afterCreate':_0x825b('0x2'),'afterUpdate':_0x825b('0x3'),'afterDestroy':_0x825b('0x4')};function emitEvent(_0x2b8041){return function(_0xf9e099,_0x5409ce,_0x28c930){VoiceExtensionEvents[_0x825b('0x5')](_0x2b8041+':'+_0xf9e099['id'],_0xf9e099);VoiceExtensionEvents['emit'](_0x2b8041,_0xf9e099);_0x28c930(null);};}for(var e in events){if(events[_0x825b('0x6')](e)){var event=events[e];VoiceExtension[_0x825b('0x7')](e,emitEvent(event));}}module[_0x825b('0x8')]=VoiceExtensionEvents;