97022127de066293fa2c5850db8afe38b8252b78
[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 _0xb99c=['jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb99c,0x1c6));var _0xcb99=function(_0x430470,_0x4b9705){_0x430470=_0x430470-0x0;var _0x2e3ee3=_0xb99c[_0x430470];return _0x2e3ee3;};'use strict';var _=require(_0xcb99('0x0'));var util=require('util');var moment=require(_0xcb99('0x1'));var BPromise=require(_0xcb99('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb99('0x3'));var db=require(_0xcb99('0x4'))['db'];var utils=require(_0xcb99('0x5'));var logger=require(_0xcb99('0x6'))('rpc');var config=require(_0xcb99('0x7'));var jayson=require(_0xcb99('0x8'));var client=jayson[_0xcb99('0x9')][_0xcb99('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x398d83,_0x12907a,_0x2691d6){return new BPromise(function(_0x1afdf3,_0x4d2b73){return client[_0xcb99('0xb')](_0x398d83,_0x2691d6)[_0xcb99('0xc')](function(_0x244a32){logger[_0xcb99('0xd')](_0xcb99('0xe'),_0x12907a,_0xcb99('0xf'));logger['debug'](_0xcb99('0x10'),_0x12907a,_0xcb99('0xf'),JSON['stringify'](_0x244a32));if(_0x244a32['error']){if(_0x244a32['error'][_0xcb99('0x11')]===0x1f4){logger[_0xcb99('0x12')](_0xcb99('0xe'),_0x12907a,_0x244a32[_0xcb99('0x12')]['message']);return _0x4d2b73(_0x244a32[_0xcb99('0x12')][_0xcb99('0x13')]);}logger[_0xcb99('0x12')](_0xcb99('0xe'),_0x12907a,_0x244a32['error']['message']);return _0x1afdf3(_0x244a32[_0xcb99('0x12')][_0xcb99('0x13')]);}else{logger[_0xcb99('0xd')](_0xcb99('0xe'),_0x12907a,_0xcb99('0xf'));_0x1afdf3(_0x244a32[_0xcb99('0x14')][_0xcb99('0x13')]);}})[_0xcb99('0x15')](function(_0x9607c4){logger[_0xcb99('0x12')](_0xcb99('0xe'),_0x12907a,_0x9607c4);_0x4d2b73(_0x9607c4);});});}