Built motion from commit (unavailable).|2.5.1
[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 _0xe0c3=['events','../../mysqldb','setMaxListeners','update','remove','emit','hook'];(function(_0x2ea969,_0x25a1ec){var _0xb93ffd=function(_0xcf3d85){while(--_0xcf3d85){_0x2ea969['push'](_0x2ea969['shift']());}};_0xb93ffd(++_0x25a1ec);}(_0xe0c3,0x1c0));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3e0c('0x0'));var UserProfile=require(_0x3e0c('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3e0c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3e0c('0x3'),'afterDestroy':_0x3e0c('0x4')};function emitEvent(_0x1e9c1b){return function(_0x267454,_0x88f1af,_0x7d8f5a){UserProfileEvents[_0x3e0c('0x5')](_0x1e9c1b+':'+_0x267454['id'],_0x267454);UserProfileEvents[_0x3e0c('0x5')](_0x1e9c1b,_0x267454);_0x7d8f5a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x3e0c('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents;