Built motion from commit (unavailable).|2.5.14
[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 _0xff61=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x5bd30e,_0x1cf617){var _0x52f137=function(_0x4ff05b){while(--_0x4ff05b){_0x5bd30e['push'](_0x5bd30e['shift']());}};_0x52f137(++_0x1cf617);}(_0xff61,0x71));var _0x1ff6=function(_0x5e3adc,_0x28a873){_0x5e3adc=_0x5e3adc-0x0;var _0x530fd9=_0xff61[_0x5e3adc];return _0x530fd9;};'use strict';var _=require(_0x1ff6('0x0'));var util=require(_0x1ff6('0x1'));var moment=require('moment');var BPromise=require(_0x1ff6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ff6('0x3'));var db=require(_0x1ff6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ff6('0x5'))(_0x1ff6('0x6'));var config=require(_0x1ff6('0x7'));var jayson=require(_0x1ff6('0x8'));var client=jayson[_0x1ff6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18edc7,_0x14a978,_0x2cc7c3){return new BPromise(function(_0x395fee,_0x52cb20){return client[_0x1ff6('0xa')](_0x18edc7,_0x2cc7c3)['then'](function(_0xb8d69e){logger[_0x1ff6('0xb')](_0x1ff6('0xc'),_0x14a978,_0x1ff6('0xd'));logger[_0x1ff6('0xe')](_0x1ff6('0xf'),_0x14a978,'request\x20sent',JSON[_0x1ff6('0x10')](_0xb8d69e));if(_0xb8d69e[_0x1ff6('0x11')]){if(_0xb8d69e[_0x1ff6('0x11')]['code']===0x1f4){logger['error'](_0x1ff6('0xc'),_0x14a978,_0xb8d69e[_0x1ff6('0x11')][_0x1ff6('0x12')]);return _0x52cb20(_0xb8d69e[_0x1ff6('0x11')][_0x1ff6('0x12')]);}logger[_0x1ff6('0x11')](_0x1ff6('0xc'),_0x14a978,_0xb8d69e[_0x1ff6('0x11')]['message']);return _0x395fee(_0xb8d69e[_0x1ff6('0x11')]['message']);}else{logger[_0x1ff6('0xb')](_0x1ff6('0xc'),_0x14a978,_0x1ff6('0xd'));_0x395fee(_0xb8d69e[_0x1ff6('0x13')][_0x1ff6('0x12')]);}})[_0x1ff6('0x14')](function(_0x1e9eb4){logger[_0x1ff6('0x11')](_0x1ff6('0xc'),_0x14a978,_0x1e9eb4);_0x52cb20(_0x1e9eb4);});});}