1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x524e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Plugin'];(function(_0x467f97,_0x226c09){var _0x51366f=function(_0x98a572){while(--_0x98a572){_0x467f97['push'](_0x467f97['shift']());}};_0x51366f(++_0x226c09);}(_0x524e,0x15e));var _0xe524=function(_0x5c8bf5,_0x26feae){_0x5c8bf5=_0x5c8bf5-0x0;var _0x1b5fc1=_0x524e[_0x5c8bf5];return _0x1b5fc1;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0xe524('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0xe524('0x1')](0x0);var events={'afterCreate':_0xe524('0x2'),'afterUpdate':_0xe524('0x3'),'afterDestroy':_0xe524('0x4')};function emitEvent(_0x379eb1){return function(_0xabd694,_0x32c90b,_0x10d37a){PluginEvents[_0xe524('0x5')](_0x379eb1+':'+_0xabd694['id'],_0xabd694);PluginEvents['emit'](_0x379eb1,_0xabd694);_0x10d37a(null);};}for(var e in events){if(events[_0xe524('0x6')](e)){var event=events[e];Plugin[_0xe524('0x7')](e,emitEvent(event));}}module[_0xe524('0x8')]=PluginEvents;