Built motion from commit e1760111.|2.6.18
[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 _0x0b5b=['jayson/promise','client','http','request','then','info','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x47b08d,_0xe365ad){var _0x581e9e=function(_0xe0be9a){while(--_0xe0be9a){_0x47b08d['push'](_0x47b08d['shift']());}};_0x581e9e(++_0xe365ad);}(_0x0b5b,0x147));var _0xb0b5=function(_0x4c18cb,_0x135e3b){_0x4c18cb=_0x4c18cb-0x0;var _0x2e9f4a=_0x0b5b[_0x4c18cb];return _0x2e9f4a;};'use strict';var _=require('lodash');var util=require(_0xb0b5('0x0'));var moment=require(_0xb0b5('0x1'));var BPromise=require(_0xb0b5('0x2'));var rs=require(_0xb0b5('0x3'));var fs=require('fs');var Redis=require(_0xb0b5('0x4'));var db=require(_0xb0b5('0x5'))['db'];var utils=require(_0xb0b5('0x6'));var logger=require(_0xb0b5('0x7'))(_0xb0b5('0x8'));var config=require('../../config/environment');var jayson=require(_0xb0b5('0x9'));var client=jayson[_0xb0b5('0xa')][_0xb0b5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7f52,_0x34779,_0x55020b){return new BPromise(function(_0xba58ce,_0xd445c7){return client[_0xb0b5('0xc')](_0x2d7f52,_0x55020b)[_0xb0b5('0xd')](function(_0x5c0107){logger[_0xb0b5('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x34779,'request\x20sent');logger[_0xb0b5('0xf')](_0xb0b5('0x10'),_0x34779,_0xb0b5('0x11'),JSON['stringify'](_0x5c0107));if(_0x5c0107[_0xb0b5('0x12')]){if(_0x5c0107[_0xb0b5('0x12')][_0xb0b5('0x13')]===0x1f4){logger[_0xb0b5('0x12')](_0xb0b5('0x14'),_0x34779,_0x5c0107['error'][_0xb0b5('0x15')]);return _0xd445c7(_0x5c0107[_0xb0b5('0x12')][_0xb0b5('0x15')]);}logger['error'](_0xb0b5('0x14'),_0x34779,_0x5c0107[_0xb0b5('0x12')][_0xb0b5('0x15')]);return _0xba58ce(_0x5c0107['error'][_0xb0b5('0x15')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x34779,_0xb0b5('0x11'));_0xba58ce(_0x5c0107[_0xb0b5('0x16')][_0xb0b5('0x15')]);}})[_0xb0b5('0x17')](function(_0x4c1956){logger[_0xb0b5('0x12')](_0xb0b5('0x14'),_0x34779,_0x4c1956);_0xd445c7(_0x4c1956);});});}