Built motion from commit (unavailable).|2.4.21
[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 _0x41c5=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','CmList','setMaxListeners'];(function(_0x3d483e,_0x25f872){var _0xcb8738=function(_0x8e8018){while(--_0x8e8018){_0x3d483e['push'](_0x3d483e['shift']());}};_0xcb8738(++_0x25f872);}(_0x41c5,0x95));var _0x541c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x41c5[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0x541c('0x0'));var CmList=require(_0x541c('0x1'))['db'][_0x541c('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x541c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x541c('0x4'),'afterDestroy':_0x541c('0x5')};function emitEvent(_0x40283){return function(_0x5854af,_0x13e9a2,_0x127852){CmListEvents[_0x541c('0x6')](_0x40283+':'+_0x5854af['id'],_0x5854af);CmListEvents[_0x541c('0x6')](_0x40283,_0x5854af);_0x127852(null);};}for(var e in events){if(events[_0x541c('0x7')](e)){var event=events[e];CmList[_0x541c('0x8')](e,emitEvent(event));}}module['exports']=CmListEvents;