Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / cmContact / cmContact.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 _0x431e=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmContact'];(function(_0x551311,_0x250998){var _0x484006=function(_0x36752a){while(--_0x36752a){_0x551311['push'](_0x551311['shift']());}};_0x484006(++_0x250998);}(_0x431e,0x11f));var _0xe431=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0x431e[_0x41cfd4];return _0x190f48;};'use strict';var EventEmitter=require(_0xe431('0x0'));var CmContact=require(_0xe431('0x1'))['db'][_0xe431('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe431('0x3')](0x0);var events={'afterCreate':_0xe431('0x4'),'afterUpdate':_0xe431('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5ba19e){return function(_0x5e68a4,_0x4ee626,_0x37b025){CmContactEvents[_0xe431('0x6')](_0x5ba19e+':'+_0x5e68a4['id'],_0x5e68a4);CmContactEvents['emit'](_0x5ba19e,_0x5e68a4);_0x37b025(null);};}for(var e in events){if(events[_0xe431('0x7')](e)){var event=events[e];CmContact[_0xe431('0x8')](e,emitEvent(event));}}module[_0xe431('0x9')]=CmContactEvents;