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 _0xf396=['events','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x2a7b8e,_0x50ffce){var _0x29b5c8=function(_0x131fe0){while(--_0x131fe0){_0x2a7b8e['push'](_0x2a7b8e['shift']());}};_0x29b5c8(++_0x50ffce);}(_0xf396,0xf0));var _0x6f39=function(_0x509f97,_0x442414){_0x509f97=_0x509f97-0x0;var _0x18bbef=_0xf396[_0x509f97];return _0x18bbef;};'use strict';var EventEmitter=require(_0x6f39('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x6f39('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x6f39('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f39('0x3'),'afterDestroy':_0x6f39('0x4')};function emitEvent(_0x31ab5a){return function(_0x4b6c4d,_0x2e8d6a,_0x35bc13){SmsAccountEvents[_0x6f39('0x5')](_0x31ab5a+':'+_0x4b6c4d['id'],_0x4b6c4d);SmsAccountEvents[_0x6f39('0x5')](_0x31ab5a,_0x4b6c4d);_0x35bc13(null);};}for(var e in events){if(events[_0x6f39('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x6f39('0x7')]=SmsAccountEvents;