2c68462da8e14f9f3138cc843e5a2469d65313e3
[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 _0x70f3=['../../config/environment','jayson/promise','http','request','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x70f3,0xd4));var _0x370f=function(_0x3a2dae,_0x3b006a){_0x3a2dae=_0x3a2dae-0x0;var _0x5f35db=_0x70f3[_0x3a2dae];return _0x5f35db;};'use strict';var _=require('lodash');var util=require(_0x370f('0x0'));var moment=require(_0x370f('0x1'));var BPromise=require(_0x370f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370f('0x3'));var db=require(_0x370f('0x4'))['db'];var utils=require(_0x370f('0x5'));var logger=require(_0x370f('0x6'))(_0x370f('0x7'));var config=require(_0x370f('0x8'));var jayson=require(_0x370f('0x9'));var client=jayson['client'][_0x370f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58358d,_0x4fde98,_0x4a615e){return new BPromise(function(_0x4ce00f,_0x181c68){return client[_0x370f('0xb')](_0x58358d,_0x4a615e)['then'](function(_0x123eee){logger[_0x370f('0xc')](_0x370f('0xd'),_0x4fde98,'request\x20sent');logger[_0x370f('0xe')](_0x370f('0xf'),_0x4fde98,_0x370f('0x10'),JSON['stringify'](_0x123eee));if(_0x123eee[_0x370f('0x11')]){if(_0x123eee[_0x370f('0x11')]['code']===0x1f4){logger[_0x370f('0x11')](_0x370f('0xd'),_0x4fde98,_0x123eee[_0x370f('0x11')]['message']);return _0x181c68(_0x123eee[_0x370f('0x11')][_0x370f('0x12')]);}logger[_0x370f('0x11')](_0x370f('0xd'),_0x4fde98,_0x123eee[_0x370f('0x11')][_0x370f('0x12')]);return _0x4ce00f(_0x123eee[_0x370f('0x11')][_0x370f('0x12')]);}else{logger[_0x370f('0xc')](_0x370f('0xd'),_0x4fde98,'request\x20sent');_0x4ce00f(_0x123eee['result']['message']);}})[_0x370f('0x13')](function(_0x250d39){logger[_0x370f('0x11')](_0x370f('0xd'),_0x4fde98,_0x250d39);_0x181c68(_0x250d39);});});}