Built motion from commit (unavailable).|2.5.29
[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 _0x627e=['events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x627e,0x14a));var _0xe627=function(_0x2a5b55,_0xcbc707){_0x2a5b55=_0x2a5b55-0x0;var _0x591d68=_0x627e[_0x2a5b55];return _0x591d68;};'use strict';var EventEmitter=require(_0xe627('0x0'));var Plugin=require(_0xe627('0x1'))['db'][_0xe627('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xe627('0x3')](0x0);var events={'afterCreate':_0xe627('0x4'),'afterUpdate':'update','afterDestroy':_0xe627('0x5')};function emitEvent(_0x328881){return function(_0x2abdc7,_0x59a2c8,_0x52923f){PluginEvents['emit'](_0x328881+':'+_0x2abdc7['id'],_0x2abdc7);PluginEvents[_0xe627('0x6')](_0x328881,_0x2abdc7);_0x52923f(null);};}for(var e in events){if(events[_0xe627('0x7')](e)){var event=events[e];Plugin[_0xe627('0x8')](e,emitEvent(event));}}module[_0xe627('0x9')]=PluginEvents;