Built motion from commit bab6f49e.|2.6.17
[motion2.git] / server / api / userProfileSection / userProfileSection.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 _0xf65e=['stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1bf8b1,_0x1b11cd){var _0x37fb94=function(_0x33a62c){while(--_0x33a62c){_0x1bf8b1['push'](_0x1bf8b1['shift']());}};_0x37fb94(++_0x1b11cd);}(_0xf65e,0x1e8));var _0xef65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf65e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef65('0x0'));var util=require(_0xef65('0x1'));var moment=require(_0xef65('0x2'));var BPromise=require(_0xef65('0x3'));var rs=require(_0xef65('0x4'));var fs=require('fs');var Redis=require(_0xef65('0x5'));var db=require(_0xef65('0x6'))['db'];var utils=require(_0xef65('0x7'));var logger=require('../../config/logger')(_0xef65('0x8'));var config=require('../../config/environment');var jayson=require(_0xef65('0x9'));var client=jayson['client'][_0xef65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24d19a,_0x171669,_0x5d4d86){return new BPromise(function(_0x577203,_0xeeb644){return client[_0xef65('0xb')](_0x24d19a,_0x5d4d86)['then'](function(_0x44d0ec){logger[_0xef65('0xc')](_0xef65('0xd'),_0x171669,_0xef65('0xe'));logger[_0xef65('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x171669,'request\x20sent',JSON[_0xef65('0x10')](_0x44d0ec));if(_0x44d0ec['error']){if(_0x44d0ec['error'][_0xef65('0x11')]===0x1f4){logger[_0xef65('0x12')](_0xef65('0xd'),_0x171669,_0x44d0ec[_0xef65('0x12')][_0xef65('0x13')]);return _0xeeb644(_0x44d0ec[_0xef65('0x12')][_0xef65('0x13')]);}logger[_0xef65('0x12')](_0xef65('0xd'),_0x171669,_0x44d0ec['error'][_0xef65('0x13')]);return _0x577203(_0x44d0ec[_0xef65('0x12')][_0xef65('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x171669,_0xef65('0xe'));_0x577203(_0x44d0ec['result']['message']);}})[_0xef65('0x14')](function(_0x39732b){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x171669,_0x39732b);_0xeeb644(_0x39732b);});});}