d6703fc081bb410174c7ed8e879578ff935fa942
[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 _0x96fd=['setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0x506cbf,_0xb7e1d8){var _0x5513f1=function(_0x25a9c4){while(--_0x25a9c4){_0x506cbf['push'](_0x506cbf['shift']());}};_0x5513f1(++_0xb7e1d8);}(_0x96fd,0x1e9));var _0xd96f=function(_0x4624d3,_0x329cb9){_0x4624d3=_0x4624d3-0x0;var _0x40678e=_0x96fd[_0x4624d3];return _0x40678e;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd96f('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd96f('0x1')](0x0);var events={'afterCreate':_0xd96f('0x2'),'afterUpdate':'update','afterDestroy':_0xd96f('0x3')};function emitEvent(_0x110958){return function(_0x44f63c,_0x22b39b,_0x5d8681){UserProfileEvents[_0xd96f('0x4')](_0x110958+':'+_0x44f63c['id'],_0x44f63c);UserProfileEvents[_0xd96f('0x4')](_0x110958,_0x44f63c);_0x5d8681(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xd96f('0x5')](e,emitEvent(event));}}module[_0xd96f('0x6')]=UserProfileEvents;