Built motion from commit 8c034dcd.|2.6.31
[motion2.git] / server / api / voicePrefix / voicePrefix.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 _0x40bc=['VoicePrefix','setMaxListeners','save','remove','emit','events','../../mysqldb'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x40bc,0x67));var _0xc40b=function(_0x2d8d24,_0x2f292f){_0x2d8d24=_0x2d8d24-0x0;var _0x1c5d30=_0x40bc[_0x2d8d24];return _0x1c5d30;};'use strict';var EventEmitter=require(_0xc40b('0x0'));var VoicePrefix=require(_0xc40b('0x1'))['db'][_0xc40b('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc40b('0x3')](0x0);var events={'afterCreate':_0xc40b('0x4'),'afterUpdate':'update','afterDestroy':_0xc40b('0x5')};function emitEvent(_0x5dc946){return function(_0x4bd02c,_0x48933f,_0x5232a0){VoicePrefixEvents[_0xc40b('0x6')](_0x5dc946+':'+_0x4bd02c['id'],_0x4bd02c);VoicePrefixEvents['emit'](_0x5dc946,_0x4bd02c);_0x5232a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;