Built motion from commit 85f716e9.|2.6.8
[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 _0xc20c=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2a8fae,_0x54fd0d){var _0x29a1fa=function(_0x1a82df){while(--_0x1a82df){_0x2a8fae['push'](_0x2a8fae['shift']());}};_0x29a1fa(++_0x54fd0d);}(_0xc20c,0x139));var _0xcc20=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xc20c[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xcc20('0x0'));var util=require(_0xcc20('0x1'));var moment=require(_0xcc20('0x2'));var BPromise=require(_0xcc20('0x3'));var rs=require(_0xcc20('0x4'));var fs=require('fs');var Redis=require(_0xcc20('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc20('0x6'));var logger=require('../../config/logger')(_0xcc20('0x7'));var config=require('../../config/environment');var jayson=require(_0xcc20('0x8'));var client=jayson[_0xcc20('0x9')][_0xcc20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x351d29,_0x58e949,_0x3a9977){return new BPromise(function(_0x3e78fa,_0xd204b1){return client['request'](_0x351d29,_0x3a9977)[_0xcc20('0xb')](function(_0x49a774){logger[_0xcc20('0xc')](_0xcc20('0xd'),_0x58e949,_0xcc20('0xe'));logger[_0xcc20('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x58e949,'request\x20sent',JSON[_0xcc20('0x10')](_0x49a774));if(_0x49a774[_0xcc20('0x11')]){if(_0x49a774[_0xcc20('0x11')][_0xcc20('0x12')]===0x1f4){logger[_0xcc20('0x11')](_0xcc20('0xd'),_0x58e949,_0x49a774[_0xcc20('0x11')]['message']);return _0xd204b1(_0x49a774[_0xcc20('0x11')][_0xcc20('0x13')]);}logger['error'](_0xcc20('0xd'),_0x58e949,_0x49a774[_0xcc20('0x11')][_0xcc20('0x13')]);return _0x3e78fa(_0x49a774[_0xcc20('0x11')][_0xcc20('0x13')]);}else{logger[_0xcc20('0xc')](_0xcc20('0xd'),_0x58e949,_0xcc20('0xe'));_0x3e78fa(_0x49a774[_0xcc20('0x14')][_0xcc20('0x13')]);}})[_0xcc20('0x15')](function(_0x21cbb3){logger[_0xcc20('0x11')](_0xcc20('0xd'),_0x58e949,_0x21cbb3);_0xd204b1(_0x21cbb3);});});}