Built motion from commit (unavailable).|2.5.11
[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 _0xf548=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0xf548,0xe7));var _0x8f54=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xf548[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x8f54('0x0'));var util=require(_0x8f54('0x1'));var moment=require(_0x8f54('0x2'));var BPromise=require('bluebird');var rs=require(_0x8f54('0x3'));var fs=require('fs');var Redis=require(_0x8f54('0x4'));var db=require(_0x8f54('0x5'))['db'];var utils=require(_0x8f54('0x6'));var logger=require(_0x8f54('0x7'))('rpc');var config=require(_0x8f54('0x8'));var jayson=require(_0x8f54('0x9'));var client=jayson[_0x8f54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ccead,_0x59eb05,_0x364fe6){return new BPromise(function(_0x7b200c,_0x1b3033){return client[_0x8f54('0xb')](_0x5ccead,_0x364fe6)[_0x8f54('0xc')](function(_0x4da21d){logger[_0x8f54('0xd')](_0x8f54('0xe'),_0x59eb05,_0x8f54('0xf'));logger['debug'](_0x8f54('0x10'),_0x59eb05,'request\x20sent',JSON[_0x8f54('0x11')](_0x4da21d));if(_0x4da21d[_0x8f54('0x12')]){if(_0x4da21d['error']['code']===0x1f4){logger[_0x8f54('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x59eb05,_0x4da21d[_0x8f54('0x12')][_0x8f54('0x13')]);return _0x1b3033(_0x4da21d[_0x8f54('0x12')][_0x8f54('0x13')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x59eb05,_0x4da21d[_0x8f54('0x12')][_0x8f54('0x13')]);return _0x7b200c(_0x4da21d['error'][_0x8f54('0x13')]);}else{logger[_0x8f54('0xd')](_0x8f54('0xe'),_0x59eb05,_0x8f54('0xf'));_0x7b200c(_0x4da21d['result']['message']);}})[_0x8f54('0x14')](function(_0x5a25df){logger[_0x8f54('0x12')](_0x8f54('0xe'),_0x59eb05,_0x5a25df);_0x1b3033(_0x5a25df);});});}