6c2b851a10b8702ef9d917d6d25a0d562ad89c5a
[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 _0x5bc1=['exports','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2682f1,_0x37a307){var _0x4310fa=function(_0x11705e){while(--_0x11705e){_0x2682f1['push'](_0x2682f1['shift']());}};_0x4310fa(++_0x37a307);}(_0x5bc1,0xb5));var _0x15bc=function(_0x5c5cfb,_0x856fe6){_0x5c5cfb=_0x5c5cfb-0x0;var _0xb89878=_0x5bc1[_0x5c5cfb];return _0xb89878;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x15bc('0x0'))['db'][_0x15bc('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x15bc('0x2')](0x0);var events={'afterCreate':_0x15bc('0x3'),'afterUpdate':_0x15bc('0x4'),'afterDestroy':_0x15bc('0x5')};function emitEvent(_0x5cd32c){return function(_0x514d81,_0xe94345,_0x231326){UserProfileEvents[_0x15bc('0x6')](_0x5cd32c+':'+_0x514d81['id'],_0x514d81);UserProfileEvents['emit'](_0x5cd32c,_0x514d81);_0x231326(null);};}for(var e in events){if(events[_0x15bc('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x15bc('0x8')]=UserProfileEvents;