Built motion from commit fe909640.|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 _0xcf8c=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x78ebd9,_0x2e2ac4){var _0x296c45=function(_0x44f6d0){while(--_0x44f6d0){_0x78ebd9['push'](_0x78ebd9['shift']());}};_0x296c45(++_0x2e2ac4);}(_0xcf8c,0xbd));var _0xccf8=function(_0x5b8fd0,_0x5f3999){_0x5b8fd0=_0x5b8fd0-0x0;var _0x5c51f9=_0xcf8c[_0x5b8fd0];return _0x5c51f9;};'use strict';var _=require(_0xccf8('0x0'));var util=require(_0xccf8('0x1'));var moment=require(_0xccf8('0x2'));var BPromise=require(_0xccf8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccf8('0x4'));var db=require(_0xccf8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xccf8('0x6'))('rpc');var config=require(_0xccf8('0x7'));var jayson=require(_0xccf8('0x8'));var client=jayson[_0xccf8('0x9')][_0xccf8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48c3a6,_0x2d2988,_0x22805e){return new BPromise(function(_0x523928,_0x577f52){return client[_0xccf8('0xb')](_0x48c3a6,_0x22805e)[_0xccf8('0xc')](function(_0x2a24b4){logger['info'](_0xccf8('0xd'),_0x2d2988,_0xccf8('0xe'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2d2988,'request\x20sent',JSON['stringify'](_0x2a24b4));if(_0x2a24b4[_0xccf8('0xf')]){if(_0x2a24b4[_0xccf8('0xf')][_0xccf8('0x10')]===0x1f4){logger[_0xccf8('0xf')](_0xccf8('0xd'),_0x2d2988,_0x2a24b4[_0xccf8('0xf')][_0xccf8('0x11')]);return _0x577f52(_0x2a24b4['error'][_0xccf8('0x11')]);}logger['error'](_0xccf8('0xd'),_0x2d2988,_0x2a24b4['error'][_0xccf8('0x11')]);return _0x523928(_0x2a24b4[_0xccf8('0xf')]['message']);}else{logger[_0xccf8('0x12')](_0xccf8('0xd'),_0x2d2988,_0xccf8('0xe'));_0x523928(_0x2a24b4[_0xccf8('0x13')][_0xccf8('0x11')]);}})[_0xccf8('0x14')](function(_0xb597ab){logger[_0xccf8('0xf')](_0xccf8('0xd'),_0x2d2988,_0xb597ab);_0x577f52(_0xb597ab);});});}