6f72e657bddc60b641f3b72314d961a60030c866
[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 _0xf1d3=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix'];(function(_0x5ebe0d,_0x17aae2){var _0x27c9fc=function(_0x2fb576){while(--_0x2fb576){_0x5ebe0d['push'](_0x5ebe0d['shift']());}};_0x27c9fc(++_0x17aae2);}(_0xf1d3,0x10d));var _0x3f1d=function(_0x11e93d,_0x25c29c){_0x11e93d=_0x11e93d-0x0;var _0x583fcc=_0xf1d3[_0x11e93d];return _0x583fcc;};'use strict';var EventEmitter=require(_0x3f1d('0x0'));var VoicePrefix=require(_0x3f1d('0x1'))['db'][_0x3f1d('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3f1d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3f1d('0x4')};function emitEvent(_0x5ef150){return function(_0xb2ea5b,_0xf4b5d5,_0x2ac14e){VoicePrefixEvents[_0x3f1d('0x5')](_0x5ef150+':'+_0xb2ea5b['id'],_0xb2ea5b);VoicePrefixEvents['emit'](_0x5ef150,_0xb2ea5b);_0x2ac14e(null);};}for(var e in events){if(events[_0x3f1d('0x6')](e)){var event=events[e];VoicePrefix[_0x3f1d('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;