Built motion from commit (unavailable).|2.5.6
[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 _0x016f=['hasOwnProperty','hook','exports','../../mysqldb','remove','emit'];(function(_0x4e1878,_0x506891){var _0x37c3a=function(_0x2367e8){while(--_0x2367e8){_0x4e1878['push'](_0x4e1878['shift']());}};_0x37c3a(++_0x506891);}(_0x016f,0x159));var _0xf016=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x016f[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require('events');var CmList=require(_0xf016('0x0'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf016('0x1')};function emitEvent(_0x23280b){return function(_0x38a3ea,_0x395937,_0x1cad92){CmListEvents[_0xf016('0x2')](_0x23280b+':'+_0x38a3ea['id'],_0x38a3ea);CmListEvents['emit'](_0x23280b,_0x38a3ea);_0x1cad92(null);};}for(var e in events){if(events[_0xf016('0x3')](e)){var event=events[e];CmList[_0xf016('0x4')](e,emitEvent(event));}}module[_0xf016('0x5')]=CmListEvents;