Built motion from commit 10af8726.|2.6.34
[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 _0x5153=['../../config/environment','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5153,0x159));var _0x3515=function(_0x1276f1,_0xcfb508){_0x1276f1=_0x1276f1-0x0;var _0x54882a=_0x5153[_0x1276f1];return _0x54882a;};'use strict';var _=require(_0x3515('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3515('0x1'));var fs=require('fs');var Redis=require(_0x3515('0x2'));var db=require(_0x3515('0x3'))['db'];var utils=require(_0x3515('0x4'));var logger=require(_0x3515('0x5'))(_0x3515('0x6'));var config=require(_0x3515('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3515('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x544c62,_0x2cb819,_0x372a29){return new BPromise(function(_0x46a64f,_0x3fd61b){return client[_0x3515('0x9')](_0x544c62,_0x372a29)[_0x3515('0xa')](function(_0x4e6ba2){logger[_0x3515('0xb')](_0x3515('0xc'),_0x2cb819,_0x3515('0xd'));logger[_0x3515('0xe')](_0x3515('0xf'),_0x2cb819,_0x3515('0xd'),JSON[_0x3515('0x10')](_0x4e6ba2));if(_0x4e6ba2[_0x3515('0x11')]){if(_0x4e6ba2[_0x3515('0x11')][_0x3515('0x12')]===0x1f4){logger[_0x3515('0x11')](_0x3515('0xc'),_0x2cb819,_0x4e6ba2[_0x3515('0x11')][_0x3515('0x13')]);return _0x3fd61b(_0x4e6ba2[_0x3515('0x11')]['message']);}logger[_0x3515('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2cb819,_0x4e6ba2[_0x3515('0x11')][_0x3515('0x13')]);return _0x46a64f(_0x4e6ba2[_0x3515('0x11')][_0x3515('0x13')]);}else{logger[_0x3515('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x2cb819,_0x3515('0xd'));_0x46a64f(_0x4e6ba2[_0x3515('0x14')][_0x3515('0x13')]);}})[_0x3515('0x15')](function(_0xb7d827){logger[_0x3515('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2cb819,_0xb7d827);_0x3fd61b(_0xb7d827);});});}