ac11c96a6e9a1c71e422dd214cacdf506c5962ce
[motion2.git] / server / api / smsAccount / smsAccount.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 _0x2ea3=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x461996,_0xfc39b){var _0x2cd79f=function(_0x441130){while(--_0x441130){_0x461996['push'](_0x461996['shift']());}};_0x2cd79f(++_0xfc39b);}(_0x2ea3,0x196));var _0x32ea=function(_0xb65759,_0x1b1b9a){_0xb65759=_0xb65759-0x0;var _0x11a85e=_0x2ea3[_0xb65759];return _0x11a85e;};'use strict';var EventEmitter=require(_0x32ea('0x0'));var SmsAccount=require(_0x32ea('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x32ea('0x2')](0x0);var events={'afterCreate':_0x32ea('0x3'),'afterUpdate':_0x32ea('0x4'),'afterDestroy':_0x32ea('0x5')};function emitEvent(_0x5f470e){return function(_0x22cc18,_0x1f459b,_0x59b0d7){SmsAccountEvents[_0x32ea('0x6')](_0x5f470e+':'+_0x22cc18['id'],_0x22cc18);SmsAccountEvents[_0x32ea('0x6')](_0x5f470e,_0x22cc18);_0x59b0d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x32ea('0x7')](e,emitEvent(event));}}module[_0x32ea('0x8')]=SmsAccountEvents;