Built motion from commit 9d7072cc.|2.5.39
[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 _0xcd35=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3cb389,_0x49f5b0){var _0x3e16b0=function(_0x11842b){while(--_0x11842b){_0x3cb389['push'](_0x3cb389['shift']());}};_0x3e16b0(++_0x49f5b0);}(_0xcd35,0x1dd));var _0x5cd3=function(_0x46a477,_0x1a3416){_0x46a477=_0x46a477-0x0;var _0x15fc3d=_0xcd35[_0x46a477];return _0x15fc3d;};'use strict';var _=require(_0x5cd3('0x0'));var util=require(_0x5cd3('0x1'));var moment=require(_0x5cd3('0x2'));var BPromise=require(_0x5cd3('0x3'));var rs=require(_0x5cd3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cd3('0x5'))['db'];var utils=require(_0x5cd3('0x6'));var logger=require(_0x5cd3('0x7'))(_0x5cd3('0x8'));var config=require(_0x5cd3('0x9'));var jayson=require(_0x5cd3('0xa'));var client=jayson[_0x5cd3('0xb')][_0x5cd3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5409c1,_0x2fff6f,_0x495ced){return new BPromise(function(_0x3025fe,_0x3723b0){return client[_0x5cd3('0xd')](_0x5409c1,_0x495ced)[_0x5cd3('0xe')](function(_0xe9d7d6){logger[_0x5cd3('0xf')](_0x5cd3('0x10'),_0x2fff6f,'request\x20sent');logger[_0x5cd3('0x11')](_0x5cd3('0x12'),_0x2fff6f,_0x5cd3('0x13'),JSON[_0x5cd3('0x14')](_0xe9d7d6));if(_0xe9d7d6[_0x5cd3('0x15')]){if(_0xe9d7d6[_0x5cd3('0x15')][_0x5cd3('0x16')]===0x1f4){logger[_0x5cd3('0x15')](_0x5cd3('0x10'),_0x2fff6f,_0xe9d7d6[_0x5cd3('0x15')][_0x5cd3('0x17')]);return _0x3723b0(_0xe9d7d6[_0x5cd3('0x15')][_0x5cd3('0x17')]);}logger['error'](_0x5cd3('0x10'),_0x2fff6f,_0xe9d7d6[_0x5cd3('0x15')]['message']);return _0x3025fe(_0xe9d7d6[_0x5cd3('0x15')][_0x5cd3('0x17')]);}else{logger[_0x5cd3('0xf')](_0x5cd3('0x10'),_0x2fff6f,_0x5cd3('0x13'));_0x3025fe(_0xe9d7d6[_0x5cd3('0x18')][_0x5cd3('0x17')]);}})['catch'](function(_0x5e384b){logger[_0x5cd3('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x2fff6f,_0x5e384b);_0x3723b0(_0x5e384b);});});}