1c543a3078711f2a26079aaf0ccc57f4e93d0a7a
[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 _0x8d20=['CmList','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x8d20,0x193));var _0x08d2=function(_0x38b354,_0x361b55){_0x38b354=_0x38b354-0x0;var _0x117801=_0x8d20[_0x38b354];return _0x117801;};'use strict';var EventEmitter=require(_0x08d2('0x0'));var CmList=require(_0x08d2('0x1'))['db'][_0x08d2('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x08d2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x08d2('0x4'),'afterDestroy':_0x08d2('0x5')};function emitEvent(_0x5131fe){return function(_0xc3bfd2,_0x76be19,_0x183cd2){CmListEvents[_0x08d2('0x6')](_0x5131fe+':'+_0xc3bfd2['id'],_0xc3bfd2);CmListEvents[_0x08d2('0x6')](_0x5131fe,_0xc3bfd2);_0x183cd2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x08d2('0x7')](e,emitEvent(event));}}module[_0x08d2('0x8')]=CmListEvents;