057f2b773365b7f24ead0c3344721f9e65b4991f
[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 _0x9036=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners','save','update'];(function(_0x3d9bdd,_0x53db51){var _0x3eb5ab=function(_0x4d6375){while(--_0x4d6375){_0x3d9bdd['push'](_0x3d9bdd['shift']());}};_0x3eb5ab(++_0x53db51);}(_0x9036,0x112));var _0x6903=function(_0x8abfd8,_0x3d1f70){_0x8abfd8=_0x8abfd8-0x0;var _0x290976=_0x9036[_0x8abfd8];return _0x290976;};'use strict';var EventEmitter=require(_0x6903('0x0'));var UserProfile=require(_0x6903('0x1'))['db'][_0x6903('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6903('0x3')](0x0);var events={'afterCreate':_0x6903('0x4'),'afterUpdate':_0x6903('0x5'),'afterDestroy':_0x6903('0x6')};function emitEvent(_0x4cf6cd){return function(_0x218280,_0x5c7a9a,_0x514b37){UserProfileEvents[_0x6903('0x7')](_0x4cf6cd+':'+_0x218280['id'],_0x218280);UserProfileEvents['emit'](_0x4cf6cd,_0x218280);_0x514b37(null);};}for(var e in events){if(events[_0x6903('0x8')](e)){var event=events[e];UserProfile[_0x6903('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents;