Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / cmList / cmList.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 _0xfe49=['hasOwnProperty','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x5613f5,_0x47407b){var _0x2a1769=function(_0x584f17){while(--_0x584f17){_0x5613f5['push'](_0x5613f5['shift']());}};_0x2a1769(++_0x47407b);}(_0xfe49,0x1d9));var _0x9fe4=function(_0x23c1a5,_0x4949e7){_0x23c1a5=_0x23c1a5-0x0;var _0x10099f=_0xfe49[_0x23c1a5];return _0x10099f;};'use strict';var EventEmitter=require(_0x9fe4('0x0'));var CmList=require(_0x9fe4('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x9fe4('0x2')](0x0);var events={'afterCreate':_0x9fe4('0x3'),'afterUpdate':_0x9fe4('0x4'),'afterDestroy':_0x9fe4('0x5')};function emitEvent(_0x5e86d7){return function(_0x456455,_0x2d1c2f,_0x50f24d){CmListEvents[_0x9fe4('0x6')](_0x5e86d7+':'+_0x456455['id'],_0x456455);CmListEvents[_0x9fe4('0x6')](_0x5e86d7,_0x456455);_0x50f24d(null);};}for(var e in events){if(events[_0x9fe4('0x7')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module['exports']=CmListEvents;