Built motion from commit (unavailable).|2.5.16
[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 _0xfff0=['hook','../../mysqldb','Plugin','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x495ba3,_0x26f73e){var _0x43ae32=function(_0x5e741e){while(--_0x5e741e){_0x495ba3['push'](_0x495ba3['shift']());}};_0x43ae32(++_0x26f73e);}(_0xfff0,0x139));var _0x0fff=function(_0x519bc1,_0xee16d4){_0x519bc1=_0x519bc1-0x0;var _0x7e7901=_0xfff0[_0x519bc1];return _0x7e7901;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x0fff('0x0'))['db'][_0x0fff('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x0fff('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0fff('0x3'),'afterDestroy':_0x0fff('0x4')};function emitEvent(_0x266f43){return function(_0x4bec60,_0x2cd3d5,_0x17911e){PluginEvents['emit'](_0x266f43+':'+_0x4bec60['id'],_0x4bec60);PluginEvents[_0x0fff('0x5')](_0x266f43,_0x4bec60);_0x17911e(null);};}for(var e in events){if(events[_0x0fff('0x6')](e)){var event=events[e];Plugin[_0x0fff('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;