Built motion from commit (unavailable).|2.5.13
[motion2.git] / server / api / plugin / plugin.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 _0x02ce=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Plugin','save'];(function(_0x2a1736,_0x1b2e59){var _0x1251b2=function(_0x96d0b4){while(--_0x96d0b4){_0x2a1736['push'](_0x2a1736['shift']());}};_0x1251b2(++_0x1b2e59);}(_0x02ce,0x1ac));var _0xe02c=function(_0x5082e1,_0x20a216){_0x5082e1=_0x5082e1-0x0;var _0xc41145=_0x02ce[_0x5082e1];return _0xc41145;};'use strict';var EventEmitter=require(_0xe02c('0x0'));var Plugin=require(_0xe02c('0x1'))['db'][_0xe02c('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe02c('0x3'),'afterUpdate':'update','afterDestroy':_0xe02c('0x4')};function emitEvent(_0x3fb463){return function(_0x46475c,_0xf4b764,_0x41b41c){PluginEvents[_0xe02c('0x5')](_0x3fb463+':'+_0x46475c['id'],_0x46475c);PluginEvents[_0xe02c('0x5')](_0x3fb463,_0x46475c);_0x41b41c(null);};}for(var e in events){if(events[_0xe02c('0x6')](e)){var event=events[e];Plugin[_0xe02c('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;