Built motion from commit (unavailable).|2.5.7
[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 _0x9582=['../../mysqldb','Plugin','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x20eb72,_0x8e1335){var _0x1e8c81=function(_0x20f96d){while(--_0x20f96d){_0x20eb72['push'](_0x20eb72['shift']());}};_0x1e8c81(++_0x8e1335);}(_0x9582,0x95));var _0x2958=function(_0x31afd9,_0x337490){_0x31afd9=_0x31afd9-0x0;var _0x58f980=_0x9582[_0x31afd9];return _0x58f980;};'use strict';var EventEmitter=require(_0x2958('0x0'));var Plugin=require(_0x2958('0x1'))['db'][_0x2958('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x2958('0x3')](0x0);var events={'afterCreate':_0x2958('0x4'),'afterUpdate':_0x2958('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a44fa){return function(_0x3b907e,_0x136c77,_0x195138){PluginEvents[_0x2958('0x6')](_0x2a44fa+':'+_0x3b907e['id'],_0x3b907e);PluginEvents[_0x2958('0x6')](_0x2a44fa,_0x3b907e);_0x195138(null);};}for(var e in events){if(events[_0x2958('0x7')](e)){var event=events[e];Plugin[_0x2958('0x8')](e,emitEvent(event));}}module[_0x2958('0x9')]=PluginEvents;