Built motion from commit (unavailable).|2.5.0
[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 _0x0424=['exports','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x301854,_0x39302f){var _0x50203c=function(_0x459341){while(--_0x459341){_0x301854['push'](_0x301854['shift']());}};_0x50203c(++_0x39302f);}(_0x0424,0x159));var _0x4042=function(_0x3130b5,_0x23faf7){_0x3130b5=_0x3130b5-0x0;var _0xa6d8a3=_0x0424[_0x3130b5];return _0xa6d8a3;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x4042('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x4042('0x1')](0x0);var events={'afterCreate':_0x4042('0x2'),'afterUpdate':_0x4042('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3cd879){return function(_0x519987,_0x491eae,_0x20d8df){PluginEvents[_0x4042('0x4')](_0x3cd879+':'+_0x519987['id'],_0x519987);PluginEvents[_0x4042('0x4')](_0x3cd879,_0x519987);_0x20d8df(null);};}for(var e in events){if(events[_0x4042('0x5')](e)){var event=events[e];Plugin[_0x4042('0x6')](e,emitEvent(event));}}module[_0x4042('0x7')]=PluginEvents;