Built motion from commit 5ba5b610.|2.5.33
[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 _0x5279=['hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x57c043,_0xa0ddeb){var _0x111fb5=function(_0x5df8e9){while(--_0x5df8e9){_0x57c043['push'](_0x57c043['shift']());}};_0x111fb5(++_0xa0ddeb);}(_0x5279,0xa9));var _0x9527=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x5279[_0x3c4f1f];return _0x19cb69;};'use strict';var EventEmitter=require(_0x9527('0x0'));var SmsAccount=require(_0x9527('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9527('0x2')](0x0);var events={'afterCreate':_0x9527('0x3'),'afterUpdate':_0x9527('0x4'),'afterDestroy':_0x9527('0x5')};function emitEvent(_0x7d294b){return function(_0x34cb53,_0x5ee381,_0x3261ec){SmsAccountEvents['emit'](_0x7d294b+':'+_0x34cb53['id'],_0x34cb53);SmsAccountEvents['emit'](_0x7d294b,_0x34cb53);_0x3261ec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x9527('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;