Built motion from commit (unavailable).|2.5.27
[motion2.git] / server / api / userProfile / userProfile.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 _0x71ab=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','request\x20sent','stringify','error','message','UserProfile,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x8b5586,_0x3944bb){var _0x1002ed=function(_0x4a5f5c){while(--_0x4a5f5c){_0x8b5586['push'](_0x8b5586['shift']());}};_0x1002ed(++_0x3944bb);}(_0x71ab,0x64));var _0xb71a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x71ab[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});config[_0xb71a('0xb')]=_[_0xb71a('0xc')](config[_0xb71a('0xb')],{'host':_0xb71a('0xd'),'port':0x18eb});var socket=require(_0xb71a('0xe'))(new Redis(config[_0xb71a('0xb')]));require(_0xb71a('0xf'))[_0xb71a('0x10')](socket);function respondWithRpcPromise(_0x2e8883,_0x517eed,_0xfec897){return new BPromise(function(_0x58956d,_0x3d7bd7){return client[_0xb71a('0x11')](_0x2e8883,_0xfec897)[_0xb71a('0x12')](function(_0x591311){logger[_0xb71a('0x13')]('UserProfile,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x517eed,_0xb71a('0x14'),JSON[_0xb71a('0x15')](_0x591311));if(_0x591311[_0xb71a('0x16')]){if(_0x591311[_0xb71a('0x16')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x3d7bd7(_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);}logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x591311[_0xb71a('0x16')][_0xb71a('0x17')]);return _0x58956d(_0x591311[_0xb71a('0x16')]['message']);}else{logger[_0xb71a('0x13')](_0xb71a('0x18'),_0x517eed,_0xb71a('0x14'));_0x58956d(_0x591311[_0xb71a('0x19')][_0xb71a('0x17')]);}})[_0xb71a('0x1a')](function(_0x349de1){logger[_0xb71a('0x16')](_0xb71a('0x18'),_0x517eed,_0x349de1);_0x3d7bd7(_0x349de1);});});}