67ccb0656cfd5c9447e1d4c4b99f46c482b0f9c2
[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 _0xe453=['error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x693120,_0x3739cc){var _0x4aeff7=function(_0x2ea994){while(--_0x2ea994){_0x693120['push'](_0x693120['shift']());}};_0x4aeff7(++_0x3739cc);}(_0xe453,0x97));var _0x3e45=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xe453[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x3e45('0x0'));var util=require(_0x3e45('0x1'));var moment=require('moment');var BPromise=require(_0x3e45('0x2'));var rs=require(_0x3e45('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e45('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3e45('0x5'));var config=require(_0x3e45('0x6'));var jayson=require(_0x3e45('0x7'));var client=jayson['client'][_0x3e45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xec261c,_0x218b1c,_0x209781){return new BPromise(function(_0x26b0d2,_0x2f040f){return client[_0x3e45('0x9')](_0xec261c,_0x209781)[_0x3e45('0xa')](function(_0x4221c9){logger[_0x3e45('0xb')](_0x3e45('0xc'),_0x218b1c,_0x3e45('0xd'));logger[_0x3e45('0xe')](_0x3e45('0xf'),_0x218b1c,_0x3e45('0xd'),JSON[_0x3e45('0x10')](_0x4221c9));if(_0x4221c9[_0x3e45('0x11')]){if(_0x4221c9['error']['code']===0x1f4){logger[_0x3e45('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x218b1c,_0x4221c9[_0x3e45('0x11')][_0x3e45('0x12')]);return _0x2f040f(_0x4221c9[_0x3e45('0x11')][_0x3e45('0x12')]);}logger['error'](_0x3e45('0xc'),_0x218b1c,_0x4221c9[_0x3e45('0x11')][_0x3e45('0x12')]);return _0x26b0d2(_0x4221c9[_0x3e45('0x11')][_0x3e45('0x12')]);}else{logger[_0x3e45('0xb')](_0x3e45('0xc'),_0x218b1c,_0x3e45('0xd'));_0x26b0d2(_0x4221c9[_0x3e45('0x13')][_0x3e45('0x12')]);}})[_0x3e45('0x14')](function(_0x189e4e){logger[_0x3e45('0x11')](_0x3e45('0xc'),_0x218b1c,_0x189e4e);_0x2f040f(_0x189e4e);});});}