Built motion from commit (unavailable).|2.5.27
[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 _0x648f=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x473ada,_0x42dde3){var _0x15bd2d=function(_0x1b3cb7){while(--_0x1b3cb7){_0x473ada['push'](_0x473ada['shift']());}};_0x15bd2d(++_0x42dde3);}(_0x648f,0xdf));var _0xf648=function(_0x2e9da9,_0x4e877a){_0x2e9da9=_0x2e9da9-0x0;var _0x264d3f=_0x648f[_0x2e9da9];return _0x264d3f;};'use strict';var _=require(_0xf648('0x0'));var util=require(_0xf648('0x1'));var moment=require(_0xf648('0x2'));var BPromise=require('bluebird');var rs=require(_0xf648('0x3'));var fs=require('fs');var Redis=require(_0xf648('0x4'));var db=require(_0xf648('0x5'))['db'];var utils=require(_0xf648('0x6'));var logger=require('../../config/logger')(_0xf648('0x7'));var config=require(_0xf648('0x8'));var jayson=require(_0xf648('0x9'));var client=jayson[_0xf648('0xa')][_0xf648('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x532c16,_0x4c21e9,_0x493909){return new BPromise(function(_0x281e7e,_0xca382e){return client[_0xf648('0xc')](_0x532c16,_0x493909)[_0xf648('0xd')](function(_0x57439c){logger[_0xf648('0xe')](_0xf648('0xf'),_0x4c21e9,_0xf648('0x10'));logger[_0xf648('0x11')](_0xf648('0x12'),_0x4c21e9,_0xf648('0x10'),JSON[_0xf648('0x13')](_0x57439c));if(_0x57439c['error']){if(_0x57439c[_0xf648('0x14')][_0xf648('0x15')]===0x1f4){logger[_0xf648('0x14')](_0xf648('0xf'),_0x4c21e9,_0x57439c[_0xf648('0x14')][_0xf648('0x16')]);return _0xca382e(_0x57439c[_0xf648('0x14')][_0xf648('0x16')]);}logger[_0xf648('0x14')](_0xf648('0xf'),_0x4c21e9,_0x57439c[_0xf648('0x14')][_0xf648('0x16')]);return _0x281e7e(_0x57439c['error'][_0xf648('0x16')]);}else{logger['info'](_0xf648('0xf'),_0x4c21e9,'request\x20sent');_0x281e7e(_0x57439c[_0xf648('0x17')][_0xf648('0x16')]);}})['catch'](function(_0x5506f4){logger[_0xf648('0x14')](_0xf648('0xf'),_0x4c21e9,_0x5506f4);_0xca382e(_0x5506f4);});});}