Built motion from commit (unavailable).|2.5.2
[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 _0xafdf=['hook','exports','events','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x50d7c7,_0x3cef1d){var _0x5cb0f5=function(_0x3c157c){while(--_0x3c157c){_0x50d7c7['push'](_0x50d7c7['shift']());}};_0x5cb0f5(++_0x3cef1d);}(_0xafdf,0x162));var _0xfafd=function(_0x34924d,_0x4f7de6){_0x34924d=_0x34924d-0x0;var _0x50f064=_0xafdf[_0x34924d];return _0x50f064;};'use strict';var EventEmitter=require(_0xfafd('0x0'));var CmList=require('../../mysqldb')['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xfafd('0x1')](0x0);var events={'afterCreate':_0xfafd('0x2'),'afterUpdate':_0xfafd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ac558){return function(_0x2a3f61,_0x384f02,_0x2de2e2){CmListEvents[_0xfafd('0x4')](_0x3ac558+':'+_0x2a3f61['id'],_0x2a3f61);CmListEvents[_0xfafd('0x4')](_0x3ac558,_0x2a3f61);_0x2de2e2(null);};}for(var e in events){if(events[_0xfafd('0x5')](e)){var event=events[e];CmList[_0xfafd('0x6')](e,emitEvent(event));}}module[_0xfafd('0x7')]=CmListEvents;