Built motion from commit (unavailable).|2.5.2
[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 _0x5d5f=['http','then','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0x5d5f,0x1ef));var _0xf5d5=function(_0x2aabc1,_0x296d1c){_0x2aabc1=_0x2aabc1-0x0;var _0x4d880c=_0x5d5f[_0x2aabc1];return _0x4d880c;};'use strict';var _=require(_0xf5d5('0x0'));var util=require(_0xf5d5('0x1'));var moment=require(_0xf5d5('0x2'));var BPromise=require(_0xf5d5('0x3'));var rs=require(_0xf5d5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5d5('0x6'))(_0xf5d5('0x7'));var config=require(_0xf5d5('0x8'));var jayson=require(_0xf5d5('0x9'));var client=jayson[_0xf5d5('0xa')][_0xf5d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6fa519,_0x51c4cc,_0x17e7c4){return new BPromise(function(_0x5a7001,_0x161f37){return client['request'](_0x6fa519,_0x17e7c4)[_0xf5d5('0xc')](function(_0x812d36){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x51c4cc,_0xf5d5('0xd'));logger['debug'](_0xf5d5('0xe'),_0x51c4cc,'request\x20sent',JSON[_0xf5d5('0xf')](_0x812d36));if(_0x812d36[_0xf5d5('0x10')]){if(_0x812d36['error'][_0xf5d5('0x11')]===0x1f4){logger[_0xf5d5('0x10')](_0xf5d5('0x12'),_0x51c4cc,_0x812d36[_0xf5d5('0x10')]['message']);return _0x161f37(_0x812d36[_0xf5d5('0x10')][_0xf5d5('0x13')]);}logger[_0xf5d5('0x10')](_0xf5d5('0x12'),_0x51c4cc,_0x812d36['error'][_0xf5d5('0x13')]);return _0x5a7001(_0x812d36[_0xf5d5('0x10')][_0xf5d5('0x13')]);}else{logger[_0xf5d5('0x14')](_0xf5d5('0x12'),_0x51c4cc,_0xf5d5('0xd'));_0x5a7001(_0x812d36[_0xf5d5('0x15')][_0xf5d5('0x13')]);}})[_0xf5d5('0x16')](function(_0x2bd5de){logger[_0xf5d5('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x51c4cc,_0x2bd5de);_0x161f37(_0x2bd5de);});});}