Built motion from commit 7158bc59.|2.5.42
[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 _0x0384=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x48fe57,_0x5f007c){var _0x33c1a4=function(_0x433ff6){while(--_0x433ff6){_0x48fe57['push'](_0x48fe57['shift']());}};_0x33c1a4(++_0x5f007c);}(_0x0384,0x1e2));var _0x4038=function(_0x2837d0,_0x1e2d59){_0x2837d0=_0x2837d0-0x0;var _0x109486=_0x0384[_0x2837d0];return _0x109486;};'use strict';var _=require(_0x4038('0x0'));var util=require('util');var moment=require(_0x4038('0x1'));var BPromise=require(_0x4038('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4038('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4038('0x4'));var logger=require(_0x4038('0x5'))(_0x4038('0x6'));var config=require(_0x4038('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4038('0x8')][_0x4038('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4556d6,_0x5a9146,_0x1623d1){return new BPromise(function(_0x2ab7e8,_0x4855be){return client[_0x4038('0xa')](_0x4556d6,_0x1623d1)[_0x4038('0xb')](function(_0xa03043){logger[_0x4038('0xc')](_0x4038('0xd'),_0x5a9146,_0x4038('0xe'));logger['debug'](_0x4038('0xf'),_0x5a9146,'request\x20sent',JSON[_0x4038('0x10')](_0xa03043));if(_0xa03043[_0x4038('0x11')]){if(_0xa03043[_0x4038('0x11')][_0x4038('0x12')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x5a9146,_0xa03043['error'][_0x4038('0x13')]);return _0x4855be(_0xa03043['error'][_0x4038('0x13')]);}logger[_0x4038('0x11')](_0x4038('0xd'),_0x5a9146,_0xa03043[_0x4038('0x11')][_0x4038('0x13')]);return _0x2ab7e8(_0xa03043['error'][_0x4038('0x13')]);}else{logger[_0x4038('0xc')](_0x4038('0xd'),_0x5a9146,_0x4038('0xe'));_0x2ab7e8(_0xa03043[_0x4038('0x14')]['message']);}})[_0x4038('0x15')](function(_0x4cfe73){logger[_0x4038('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x5a9146,_0x4cfe73);_0x4855be(_0x4cfe73);});});}