77028c9be962777b66b1bce9ddadd9e282d27336
[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 _0x621b=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x16bc5a,_0x7f3c97){var _0x310ae5=function(_0x12f304){while(--_0x12f304){_0x16bc5a['push'](_0x16bc5a['shift']());}};_0x310ae5(++_0x7f3c97);}(_0x621b,0x10a));var _0xb621=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x621b[_0x29d94e];return _0x106237;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xb621('0x0'))['db'][_0xb621('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xb621('0x2')](0x0);var events={'afterCreate':_0xb621('0x3'),'afterUpdate':_0xb621('0x4'),'afterDestroy':_0xb621('0x5')};function emitEvent(_0x22efac){return function(_0x1834dc,_0x398b5b,_0x2cd593){UserProfileEvents['emit'](_0x22efac+':'+_0x1834dc['id'],_0x1834dc);UserProfileEvents[_0xb621('0x6')](_0x22efac,_0x1834dc);_0x2cd593(null);};}for(var e in events){if(events[_0xb621('0x7')](e)){var event=events[e];UserProfile[_0xb621('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents;