Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / userNotification / userNotification.rpc.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 _0x141b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f56ff,_0x557a79){var _0x4835b5=function(_0x4da01d){while(--_0x4da01d){_0x4f56ff['push'](_0x4f56ff['shift']());}};_0x4835b5(++_0x557a79);}(_0x141b,0x1ca));var _0xb141=function(_0x5ce89a,_0x466d28){_0x5ce89a=_0x5ce89a-0x0;var _0x1cad05=_0x141b[_0x5ce89a];return _0x1cad05;};'use strict';var _=require('lodash');var util=require(_0xb141('0x0'));var moment=require(_0xb141('0x1'));var BPromise=require(_0xb141('0x2'));var rs=require(_0xb141('0x3'));var fs=require('fs');var Redis=require(_0xb141('0x4'));var db=require(_0xb141('0x5'))['db'];var utils=require(_0xb141('0x6'));var logger=require(_0xb141('0x7'))(_0xb141('0x8'));var config=require(_0xb141('0x9'));var jayson=require(_0xb141('0xa'));var client=jayson[_0xb141('0xb')][_0xb141('0xc')]({'port':0x232a});config['redis']=_[_0xb141('0xd')](config[_0xb141('0xe')],{'host':_0xb141('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb141('0xe')]));require(_0xb141('0x10'))[_0xb141('0x11')](socket);function respondWithRpcPromise(_0x2aa119,_0xd4ea3a,_0x31602c){return new BPromise(function(_0x2b8d02,_0x2ae7be){return client[_0xb141('0x12')](_0x2aa119,_0x31602c)[_0xb141('0x13')](function(_0x518c11){logger['info'](_0xb141('0x14'),_0xd4ea3a,_0xb141('0x15'));logger['debug'](_0xb141('0x16'),_0xd4ea3a,_0xb141('0x15'),JSON[_0xb141('0x17')](_0x518c11));if(_0x518c11['error']){if(_0x518c11[_0xb141('0x18')][_0xb141('0x19')]===0x1f4){logger['error'](_0xb141('0x14'),_0xd4ea3a,_0x518c11[_0xb141('0x18')][_0xb141('0x1a')]);return _0x2ae7be(_0x518c11[_0xb141('0x18')][_0xb141('0x1a')]);}logger[_0xb141('0x18')](_0xb141('0x14'),_0xd4ea3a,_0x518c11[_0xb141('0x18')]['message']);return _0x2b8d02(_0x518c11[_0xb141('0x18')]['message']);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0xd4ea3a,_0xb141('0x15'));_0x2b8d02(_0x518c11[_0xb141('0x1b')]['message']);}})[_0xb141('0x1c')](function(_0x3093b7){logger[_0xb141('0x18')]('UserNotification,\x20%s,\x20%s',_0xd4ea3a,_0x3093b7);_0x2ae7be(_0x3093b7);});});}