8a15ba9d78c74200f8d5d922ae61865a007837e1
[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 _0x9ea3=['info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x5575af,_0x1a2157){var _0x4ab648=function(_0x1c5a88){while(--_0x1c5a88){_0x5575af['push'](_0x5575af['shift']());}};_0x4ab648(++_0x1a2157);}(_0x9ea3,0x126));var _0x39ea=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x9ea3[_0x2642cb];return _0xe6e41;};'use strict';var _=require(_0x39ea('0x0'));var util=require(_0x39ea('0x1'));var moment=require(_0x39ea('0x2'));var BPromise=require(_0x39ea('0x3'));var rs=require(_0x39ea('0x4'));var fs=require('fs');var Redis=require(_0x39ea('0x5'));var db=require(_0x39ea('0x6'))['db'];var utils=require(_0x39ea('0x7'));var logger=require(_0x39ea('0x8'))('rpc');var config=require(_0x39ea('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x39ea('0xa')][_0x39ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29e097,_0x48b0b6,_0x433300){return new BPromise(function(_0x437f50,_0x3f9583){return client[_0x39ea('0xc')](_0x29e097,_0x433300)[_0x39ea('0xd')](function(_0x371b60){logger[_0x39ea('0xe')](_0x39ea('0xf'),_0x48b0b6,'request\x20sent');logger[_0x39ea('0x10')](_0x39ea('0x11'),_0x48b0b6,'request\x20sent',JSON[_0x39ea('0x12')](_0x371b60));if(_0x371b60['error']){if(_0x371b60[_0x39ea('0x13')][_0x39ea('0x14')]===0x1f4){logger['error'](_0x39ea('0xf'),_0x48b0b6,_0x371b60[_0x39ea('0x13')][_0x39ea('0x15')]);return _0x3f9583(_0x371b60[_0x39ea('0x13')][_0x39ea('0x15')]);}logger['error'](_0x39ea('0xf'),_0x48b0b6,_0x371b60[_0x39ea('0x13')]['message']);return _0x437f50(_0x371b60[_0x39ea('0x13')][_0x39ea('0x15')]);}else{logger[_0x39ea('0xe')](_0x39ea('0xf'),_0x48b0b6,'request\x20sent');_0x437f50(_0x371b60['result'][_0x39ea('0x15')]);}})['catch'](function(_0x1d3024){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x48b0b6,_0x1d3024);_0x3f9583(_0x1d3024);});});}