Built motion from commit (unavailable).|2.5.10
[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 _0x8689=['info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','then'];(function(_0x5e5202,_0x3f6212){var _0x3e580b=function(_0x2ebc86){while(--_0x2ebc86){_0x5e5202['push'](_0x5e5202['shift']());}};_0x3e580b(++_0x3f6212);}(_0x8689,0x100));var _0x9868=function(_0x4b7a53,_0x509ba0){_0x4b7a53=_0x4b7a53-0x0;var _0x193400=_0x8689[_0x4b7a53];return _0x193400;};'use strict';var _=require(_0x9868('0x0'));var util=require(_0x9868('0x1'));var moment=require(_0x9868('0x2'));var BPromise=require('bluebird');var rs=require(_0x9868('0x3'));var fs=require('fs');var Redis=require(_0x9868('0x4'));var db=require(_0x9868('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9868('0x6'));var config=require(_0x9868('0x7'));var jayson=require(_0x9868('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x79b16b,_0x1690e7,_0x32f7fc){return new BPromise(function(_0x2830b3,_0x312d5a){return client['request'](_0x79b16b,_0x32f7fc)[_0x9868('0x9')](function(_0x1c5b94){logger[_0x9868('0xa')](_0x9868('0xb'),_0x1690e7,_0x9868('0xc'));logger[_0x9868('0xd')](_0x9868('0xe'),_0x1690e7,_0x9868('0xc'),JSON[_0x9868('0xf')](_0x1c5b94));if(_0x1c5b94[_0x9868('0x10')]){if(_0x1c5b94[_0x9868('0x10')]['code']===0x1f4){logger[_0x9868('0x10')](_0x9868('0xb'),_0x1690e7,_0x1c5b94[_0x9868('0x10')][_0x9868('0x11')]);return _0x312d5a(_0x1c5b94[_0x9868('0x10')][_0x9868('0x11')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1690e7,_0x1c5b94[_0x9868('0x10')][_0x9868('0x11')]);return _0x2830b3(_0x1c5b94[_0x9868('0x10')]['message']);}else{logger[_0x9868('0xa')](_0x9868('0xb'),_0x1690e7,'request\x20sent');_0x2830b3(_0x1c5b94['result'][_0x9868('0x11')]);}})[_0x9868('0x12')](function(_0xbcd633){logger['error'](_0x9868('0xb'),_0x1690e7,_0xbcd633);_0x312d5a(_0xbcd633);});});}