8365fbc470c93c5b5b9a78e34432fdf2f6663d4d
[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 _0x687a=['hook','exports','events','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x687a,0xe8));var _0xa687=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x687a[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0xa687('0x0'));var VoiceExtension=require(_0xa687('0x1'))['db'][_0xa687('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa687('0x3'),'afterUpdate':_0xa687('0x4'),'afterDestroy':_0xa687('0x5')};function emitEvent(_0x3bb399){return function(_0x12f2c1,_0x49263e,_0x48bf3e){VoiceExtensionEvents[_0xa687('0x6')](_0x3bb399+':'+_0x12f2c1['id'],_0x12f2c1);VoiceExtensionEvents[_0xa687('0x6')](_0x3bb399,_0x12f2c1);_0x48bf3e(null);};}for(var e in events){if(events[_0xa687('0x7')](e)){var event=events[e];VoiceExtension[_0xa687('0x8')](e,emitEvent(event));}}module[_0xa687('0x9')]=VoiceExtensionEvents;