b62d57e85373b7faf913fe2c1aed4af1d831d38a
[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 _0x52f8=['client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x52f8,0xaf));var _0x852f=function(_0xa9d519,_0x3684b6){_0xa9d519=_0xa9d519-0x0;var _0x56c128=_0x52f8[_0xa9d519];return _0x56c128;};'use strict';var _=require(_0x852f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x852f('0x1'));var rs=require(_0x852f('0x2'));var fs=require('fs');var Redis=require(_0x852f('0x3'));var db=require(_0x852f('0x4'))['db'];var utils=require(_0x852f('0x5'));var logger=require(_0x852f('0x6'))('rpc');var config=require(_0x852f('0x7'));var jayson=require(_0x852f('0x8'));var client=jayson[_0x852f('0x9')][_0x852f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f3281,_0x40dfc0,_0x2deced){return new BPromise(function(_0xd8a2e,_0x1c749b){return client[_0x852f('0xb')](_0x2f3281,_0x2deced)[_0x852f('0xc')](function(_0x195e77){logger[_0x852f('0xd')](_0x852f('0xe'),_0x40dfc0,'request\x20sent');logger[_0x852f('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x40dfc0,_0x852f('0x10'),JSON[_0x852f('0x11')](_0x195e77));if(_0x195e77[_0x852f('0x12')]){if(_0x195e77[_0x852f('0x12')][_0x852f('0x13')]===0x1f4){logger['error'](_0x852f('0xe'),_0x40dfc0,_0x195e77[_0x852f('0x12')][_0x852f('0x14')]);return _0x1c749b(_0x195e77['error'][_0x852f('0x14')]);}logger[_0x852f('0x12')](_0x852f('0xe'),_0x40dfc0,_0x195e77[_0x852f('0x12')][_0x852f('0x14')]);return _0xd8a2e(_0x195e77[_0x852f('0x12')]['message']);}else{logger[_0x852f('0xd')](_0x852f('0xe'),_0x40dfc0,'request\x20sent');_0xd8a2e(_0x195e77[_0x852f('0x15')]['message']);}})[_0x852f('0x16')](function(_0x5d94ee){logger[_0x852f('0x12')](_0x852f('0xe'),_0x40dfc0,_0x5d94ee);_0x1c749b(_0x5d94ee);});});}