03556b1af6d8be6b237e58b3eea60ab252285b27
[motion2.git] / server / api / smsQueue / smsQueue.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 _0xc8cb=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue'];(function(_0x158414,_0x5ab714){var _0x3db75b=function(_0x19d0eb){while(--_0x19d0eb){_0x158414['push'](_0x158414['shift']());}};_0x3db75b(++_0x5ab714);}(_0xc8cb,0xed));var _0xbc8c=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0xc8cb[_0x287a47];return _0x3fb726;};'use strict';var EventEmitter=require(_0xbc8c('0x0'));var SmsQueue=require(_0xbc8c('0x1'))['db'][_0xbc8c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbc8c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc8c('0x4'),'afterDestroy':_0xbc8c('0x5')};function emitEvent(_0x5e93c7){return function(_0x5487fc,_0x205fc7,_0xe467da){SmsQueueEvents[_0xbc8c('0x6')](_0x5e93c7+':'+_0x5487fc['id'],_0x5487fc);SmsQueueEvents[_0xbc8c('0x6')](_0x5e93c7,_0x5487fc);_0xe467da(null);};}for(var e in events){if(events[_0xbc8c('0x7')](e)){var event=events[e];SmsQueue[_0xbc8c('0x8')](e,emitEvent(event));}}module[_0xbc8c('0x9')]=SmsQueueEvents;