Built motion from commit (unavailable).|2.6.0
[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 _0xf249=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','bluebird','randomstring'];(function(_0x48ed52,_0x54ffc1){var _0x3c2f33=function(_0x3893d9){while(--_0x3893d9){_0x48ed52['push'](_0x48ed52['shift']());}};_0x3c2f33(++_0x54ffc1);}(_0xf249,0x172));var _0x9f24=function(_0x49c6a5,_0x46b821){_0x49c6a5=_0x49c6a5-0x0;var _0x2975d6=_0xf249[_0x49c6a5];return _0x2975d6;};'use strict';var _=require(_0x9f24('0x0'));var util=require(_0x9f24('0x1'));var moment=require('moment');var BPromise=require(_0x9f24('0x2'));var rs=require(_0x9f24('0x3'));var fs=require('fs');var Redis=require(_0x9f24('0x4'));var db=require(_0x9f24('0x5'))['db'];var utils=require(_0x9f24('0x6'));var logger=require(_0x9f24('0x7'))(_0x9f24('0x8'));var config=require('../../config/environment');var jayson=require(_0x9f24('0x9'));var client=jayson[_0x9f24('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x459c3c,_0x59a2b1,_0x567e20){return new BPromise(function(_0x4eb319,_0x5c7622){return client[_0x9f24('0xb')](_0x459c3c,_0x567e20)[_0x9f24('0xc')](function(_0x40dfe9){logger['info'](_0x9f24('0xd'),_0x59a2b1,_0x9f24('0xe'));logger[_0x9f24('0xf')](_0x9f24('0x10'),_0x59a2b1,'request\x20sent',JSON[_0x9f24('0x11')](_0x40dfe9));if(_0x40dfe9['error']){if(_0x40dfe9[_0x9f24('0x12')]['code']===0x1f4){logger[_0x9f24('0x12')](_0x9f24('0xd'),_0x59a2b1,_0x40dfe9[_0x9f24('0x12')]['message']);return _0x5c7622(_0x40dfe9[_0x9f24('0x12')][_0x9f24('0x13')]);}logger[_0x9f24('0x12')](_0x9f24('0xd'),_0x59a2b1,_0x40dfe9[_0x9f24('0x12')][_0x9f24('0x13')]);return _0x4eb319(_0x40dfe9[_0x9f24('0x12')][_0x9f24('0x13')]);}else{logger[_0x9f24('0x14')](_0x9f24('0xd'),_0x59a2b1,_0x9f24('0xe'));_0x4eb319(_0x40dfe9['result'][_0x9f24('0x13')]);}})[_0x9f24('0x15')](function(_0x24e839){logger[_0x9f24('0x12')](_0x9f24('0xd'),_0x59a2b1,_0x24e839);_0x5c7622(_0x24e839);});});}