4e9264fb35d5965dfc2319358ed3b24795bee235
[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 _0xcf58=['stringify','error','code','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x102532,_0x58fa87){var _0x44f2b4=function(_0x19dbff){while(--_0x19dbff){_0x102532['push'](_0x102532['shift']());}};_0x44f2b4(++_0x58fa87);}(_0xcf58,0x1be));var _0x8cf5=function(_0x83d867,_0xb7a1fb){_0x83d867=_0x83d867-0x0;var _0x419356=_0xcf58[_0x83d867];return _0x419356;};'use strict';var _=require(_0x8cf5('0x0'));var util=require(_0x8cf5('0x1'));var moment=require(_0x8cf5('0x2'));var BPromise=require('bluebird');var rs=require(_0x8cf5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cf5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8cf5('0x5'))(_0x8cf5('0x6'));var config=require(_0x8cf5('0x7'));var jayson=require(_0x8cf5('0x8'));var client=jayson['client'][_0x8cf5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44c91b,_0x42780a,_0x28b3a9){return new BPromise(function(_0x348660,_0x519b59){return client[_0x8cf5('0xa')](_0x44c91b,_0x28b3a9)['then'](function(_0x4aaef9){logger[_0x8cf5('0xb')](_0x8cf5('0xc'),_0x42780a,_0x8cf5('0xd'));logger[_0x8cf5('0xe')](_0x8cf5('0xf'),_0x42780a,_0x8cf5('0xd'),JSON[_0x8cf5('0x10')](_0x4aaef9));if(_0x4aaef9['error']){if(_0x4aaef9[_0x8cf5('0x11')][_0x8cf5('0x12')]===0x1f4){logger[_0x8cf5('0x11')](_0x8cf5('0xc'),_0x42780a,_0x4aaef9[_0x8cf5('0x11')][_0x8cf5('0x13')]);return _0x519b59(_0x4aaef9['error'][_0x8cf5('0x13')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x42780a,_0x4aaef9[_0x8cf5('0x11')]['message']);return _0x348660(_0x4aaef9[_0x8cf5('0x11')][_0x8cf5('0x13')]);}else{logger[_0x8cf5('0xb')](_0x8cf5('0xc'),_0x42780a,_0x8cf5('0xd'));_0x348660(_0x4aaef9['result'][_0x8cf5('0x13')]);}})[_0x8cf5('0x14')](function(_0x295273){logger['error'](_0x8cf5('0xc'),_0x42780a,_0x295273);_0x519b59(_0x295273);});});}