Built motion from commit da24aabd.|2.6.20
[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 _0x8dbd=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x38289c,_0x16c002){var _0x335486=function(_0x3be7fa){while(--_0x3be7fa){_0x38289c['push'](_0x38289c['shift']());}};_0x335486(++_0x16c002);}(_0x8dbd,0x159));var _0xd8db=function(_0x501b9b,_0x55ed20){_0x501b9b=_0x501b9b-0x0;var _0x508f16=_0x8dbd[_0x501b9b];return _0x508f16;};'use strict';var _=require(_0xd8db('0x0'));var util=require(_0xd8db('0x1'));var moment=require('moment');var BPromise=require(_0xd8db('0x2'));var rs=require(_0xd8db('0x3'));var fs=require('fs');var Redis=require(_0xd8db('0x4'));var db=require(_0xd8db('0x5'))['db'];var utils=require(_0xd8db('0x6'));var logger=require(_0xd8db('0x7'))(_0xd8db('0x8'));var config=require(_0xd8db('0x9'));var jayson=require(_0xd8db('0xa'));var client=jayson[_0xd8db('0xb')][_0xd8db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2c08cf,_0x1fc5f1,_0x80f8e9){return new BPromise(function(_0x3bdf6a,_0x53afb5){return client[_0xd8db('0xd')](_0x2c08cf,_0x80f8e9)['then'](function(_0x10c57e){logger[_0xd8db('0xe')](_0xd8db('0xf'),_0x1fc5f1,_0xd8db('0x10'));logger[_0xd8db('0x11')](_0xd8db('0x12'),_0x1fc5f1,_0xd8db('0x10'),JSON[_0xd8db('0x13')](_0x10c57e));if(_0x10c57e[_0xd8db('0x14')]){if(_0x10c57e[_0xd8db('0x14')]['code']===0x1f4){logger[_0xd8db('0x14')](_0xd8db('0xf'),_0x1fc5f1,_0x10c57e[_0xd8db('0x14')][_0xd8db('0x15')]);return _0x53afb5(_0x10c57e[_0xd8db('0x14')][_0xd8db('0x15')]);}logger[_0xd8db('0x14')](_0xd8db('0xf'),_0x1fc5f1,_0x10c57e['error']['message']);return _0x3bdf6a(_0x10c57e[_0xd8db('0x14')][_0xd8db('0x15')]);}else{logger['info'](_0xd8db('0xf'),_0x1fc5f1,_0xd8db('0x10'));_0x3bdf6a(_0x10c57e['result'][_0xd8db('0x15')]);}})[_0xd8db('0x16')](function(_0x437806){logger[_0xd8db('0x14')](_0xd8db('0xf'),_0x1fc5f1,_0x437806);_0x53afb5(_0x437806);});});}