Built motion from commit (unavailable).|2.5.11
[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 _0x0c5e=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x49931c,_0x4436cd){var _0x31551f=function(_0x154fd6){while(--_0x154fd6){_0x49931c['push'](_0x49931c['shift']());}};_0x31551f(++_0x4436cd);}(_0x0c5e,0x101));var _0xe0c5=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0x0c5e[_0x2f1753];return _0x56a164;};'use strict';var EventEmitter=require(_0xe0c5('0x0'));var SmsAccount=require(_0xe0c5('0x1'))['db'][_0xe0c5('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe0c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe0c5('0x4'),'afterDestroy':_0xe0c5('0x5')};function emitEvent(_0x4583b2){return function(_0x517744,_0xc6b367,_0x24bc8a){SmsAccountEvents[_0xe0c5('0x6')](_0x4583b2+':'+_0x517744['id'],_0x517744);SmsAccountEvents[_0xe0c5('0x6')](_0x4583b2,_0x517744);_0x24bc8a(null);};}for(var e in events){if(events[_0xe0c5('0x7')](e)){var event=events[e];SmsAccount[_0xe0c5('0x8')](e,emitEvent(event));}}module[_0xe0c5('0x9')]=SmsAccountEvents;