Built motion from commit f7863d46.|2.5.41
[motion2.git] / server / api / userProfileResource / userProfileResource.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 _0x5d3f=['message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','UserProfileResource,\x20%s,\x20%s'];(function(_0x4a177c,_0x2bd612){var _0x54dd37=function(_0x58b775){while(--_0x58b775){_0x4a177c['push'](_0x4a177c['shift']());}};_0x54dd37(++_0x2bd612);}(_0x5d3f,0x10d));var _0xf5d3=function(_0x4055e5,_0x27641c){_0x4055e5=_0x4055e5-0x0;var _0x2c33ec=_0x5d3f[_0x4055e5];return _0x2c33ec;};'use strict';var _=require(_0xf5d3('0x0'));var util=require(_0xf5d3('0x1'));var moment=require('moment');var BPromise=require(_0xf5d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf5d3('0x4'))(_0xf5d3('0x5'));var config=require(_0xf5d3('0x6'));var jayson=require(_0xf5d3('0x7'));var client=jayson['client'][_0xf5d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22a7c3,_0x53842c,_0x30db2e){return new BPromise(function(_0x475004,_0x1c616e){return client[_0xf5d3('0x9')](_0x22a7c3,_0x30db2e)[_0xf5d3('0xa')](function(_0x1129a8){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x53842c,_0xf5d3('0xb'));logger[_0xf5d3('0xc')](_0xf5d3('0xd'),_0x53842c,_0xf5d3('0xb'),JSON['stringify'](_0x1129a8));if(_0x1129a8['error']){if(_0x1129a8[_0xf5d3('0xe')]['code']===0x1f4){logger[_0xf5d3('0xe')](_0xf5d3('0xf'),_0x53842c,_0x1129a8['error'][_0xf5d3('0x10')]);return _0x1c616e(_0x1129a8['error'][_0xf5d3('0x10')]);}logger[_0xf5d3('0xe')](_0xf5d3('0xf'),_0x53842c,_0x1129a8[_0xf5d3('0xe')][_0xf5d3('0x10')]);return _0x475004(_0x1129a8['error'][_0xf5d3('0x10')]);}else{logger['info'](_0xf5d3('0xf'),_0x53842c,_0xf5d3('0xb'));_0x475004(_0x1129a8[_0xf5d3('0x11')][_0xf5d3('0x10')]);}})[_0xf5d3('0x12')](function(_0x25dc76){logger['error'](_0xf5d3('0xf'),_0x53842c,_0x25dc76);_0x1c616e(_0x25dc76);});});}