Built motion from commit (unavailable).|2.5.4
[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 _0xefc3=['remove','emit','hasOwnProperty','exports','CmList','setMaxListeners','save'];(function(_0x48ec91,_0x212edc){var _0x22766c=function(_0x136751){while(--_0x136751){_0x48ec91['push'](_0x48ec91['shift']());}};_0x22766c(++_0x212edc);}(_0xefc3,0x193));var _0x3efc=function(_0x1de284,_0x32f38a){_0x1de284=_0x1de284-0x0;var _0x3b6016=_0xefc3[_0x1de284];return _0x3b6016;};'use strict';var EventEmitter=require('events');var CmList=require('../../mysqldb')['db'][_0x3efc('0x0')];var CmListEvents=new EventEmitter();CmListEvents[_0x3efc('0x1')](0x0);var events={'afterCreate':_0x3efc('0x2'),'afterUpdate':'update','afterDestroy':_0x3efc('0x3')};function emitEvent(_0x56bab8){return function(_0x5ccdd9,_0x424bff,_0x34295c){CmListEvents[_0x3efc('0x4')](_0x56bab8+':'+_0x5ccdd9['id'],_0x5ccdd9);CmListEvents[_0x3efc('0x4')](_0x56bab8,_0x5ccdd9);_0x34295c(null);};}for(var e in events){if(events[_0x3efc('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x3efc('0x6')]=CmListEvents;