Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / api / userProfileSection / userProfileSection.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 _0xa1e2=['stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa1e2,0xae));var _0x2a1e=function(_0x287499,_0x1c6ad9){_0x287499=_0x287499-0x0;var _0x56b65d=_0xa1e2[_0x287499];return _0x56b65d;};'use strict';var _=require(_0x2a1e('0x0'));var util=require('util');var moment=require(_0x2a1e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2a1e('0x2'));var fs=require('fs');var Redis=require(_0x2a1e('0x3'));var db=require(_0x2a1e('0x4'))['db'];var utils=require(_0x2a1e('0x5'));var logger=require(_0x2a1e('0x6'))(_0x2a1e('0x7'));var config=require(_0x2a1e('0x8'));var jayson=require(_0x2a1e('0x9'));var client=jayson[_0x2a1e('0xa')][_0x2a1e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3634db,_0x155e4f,_0x2c1061){return new BPromise(function(_0x351d89,_0x7d7b4c){return client['request'](_0x3634db,_0x2c1061)[_0x2a1e('0xc')](function(_0x128f44){logger[_0x2a1e('0xd')](_0x2a1e('0xe'),_0x155e4f,_0x2a1e('0xf'));logger[_0x2a1e('0x10')](_0x2a1e('0x11'),_0x155e4f,_0x2a1e('0xf'),JSON[_0x2a1e('0x12')](_0x128f44));if(_0x128f44[_0x2a1e('0x13')]){if(_0x128f44['error'][_0x2a1e('0x14')]===0x1f4){logger[_0x2a1e('0x13')](_0x2a1e('0xe'),_0x155e4f,_0x128f44['error'][_0x2a1e('0x15')]);return _0x7d7b4c(_0x128f44[_0x2a1e('0x13')][_0x2a1e('0x15')]);}logger[_0x2a1e('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x155e4f,_0x128f44[_0x2a1e('0x13')][_0x2a1e('0x15')]);return _0x351d89(_0x128f44['error']['message']);}else{logger[_0x2a1e('0xd')](_0x2a1e('0xe'),_0x155e4f,_0x2a1e('0xf'));_0x351d89(_0x128f44[_0x2a1e('0x16')][_0x2a1e('0x15')]);}})[_0x2a1e('0x17')](function(_0x14c082){logger['error'](_0x2a1e('0xe'),_0x155e4f,_0x14c082);_0x7d7b4c(_0x14c082);});});}