7e1a34cc93d8226e00a8c3e8f4cf41cbca0a43d7
[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 _0x1efa=['events','../../mysqldb','SmsAccount','update','emit','hasOwnProperty','exports'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x1efa,0x69));var _0xa1ef=function(_0x4ac4ae,_0x269c7){_0x4ac4ae=_0x4ac4ae-0x0;var _0x389f3e=_0x1efa[_0x4ac4ae];return _0x389f3e;};'use strict';var EventEmitter=require(_0xa1ef('0x0'));var SmsAccount=require(_0xa1ef('0x1'))['db'][_0xa1ef('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa1ef('0x3'),'afterDestroy':'remove'};function emitEvent(_0x34701e){return function(_0x54d9a3,_0x3cff72,_0x50eadd){SmsAccountEvents[_0xa1ef('0x4')](_0x34701e+':'+_0x54d9a3['id'],_0x54d9a3);SmsAccountEvents[_0xa1ef('0x4')](_0x34701e,_0x54d9a3);_0x50eadd(null);};}for(var e in events){if(events[_0xa1ef('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xa1ef('0x6')]=SmsAccountEvents;