Built motion from commit 639a1a7f.|2.6.19
[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 _0x7f51=['update','remove','emit','hook','events','SmsAccount','save'];(function(_0x2facb7,_0x2777fe){var _0x2fe7c1=function(_0x66f605){while(--_0x66f605){_0x2facb7['push'](_0x2facb7['shift']());}};_0x2fe7c1(++_0x2777fe);}(_0x7f51,0x1c4));var _0x17f5=function(_0x202d7e,_0x258c91){_0x202d7e=_0x202d7e-0x0;var _0x3b8c27=_0x7f51[_0x202d7e];return _0x3b8c27;};'use strict';var EventEmitter=require(_0x17f5('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x17f5('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17f5('0x2'),'afterUpdate':_0x17f5('0x3'),'afterDestroy':_0x17f5('0x4')};function emitEvent(_0x12de3e){return function(_0x3f3d8f,_0x58ad2e,_0x4fa7fb){SmsAccountEvents[_0x17f5('0x5')](_0x12de3e+':'+_0x3f3d8f['id'],_0x3f3d8f);SmsAccountEvents[_0x17f5('0x5')](_0x12de3e,_0x3f3d8f);_0x4fa7fb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x17f5('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;