fe64f49f9fd5f6176fa8bf74507344675a23ae59
[motion2.git] / server / api / userProfile / userProfile.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 _0xc1c6=['../../mysqldb','UserProfile','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x46a688,_0x3ee9f8){var _0x4bcb44=function(_0x294b66){while(--_0x294b66){_0x46a688['push'](_0x46a688['shift']());}};_0x4bcb44(++_0x3ee9f8);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2934aa,_0x321a70){_0x2934aa=_0x2934aa-0x0;var _0x55ac8e=_0xc1c6[_0x2934aa];return _0x55ac8e;};'use strict';var EventEmitter=require(_0x6c1c('0x0'));var UserProfile=require(_0x6c1c('0x1'))['db'][_0x6c1c('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c1c('0x3'),'afterUpdate':'update','afterDestroy':_0x6c1c('0x4')};function emitEvent(_0x40ff59){return function(_0x265d2c,_0x59f799,_0x56ed6f){UserProfileEvents[_0x6c1c('0x5')](_0x40ff59+':'+_0x265d2c['id'],_0x265d2c);UserProfileEvents['emit'](_0x40ff59,_0x265d2c);_0x56ed6f(null);};}for(var e in events){if(events[_0x6c1c('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x6c1c('0x7')]=UserProfileEvents;