7769a221656067484499b6f06dd637f371cb2b5b
[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 _0xc03c=['catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x1885f3,_0x3408e8){var _0x5de352=function(_0x6bc4fe){while(--_0x6bc4fe){_0x1885f3['push'](_0x1885f3['shift']());}};_0x5de352(++_0x3408e8);}(_0xc03c,0x16a));var _0xcc03=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0xc03c[_0x49beea];return _0x27693a;};'use strict';var _=require(_0xcc03('0x0'));var util=require(_0xcc03('0x1'));var moment=require(_0xcc03('0x2'));var BPromise=require(_0xcc03('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc03('0x4'))['db'];var utils=require(_0xcc03('0x5'));var logger=require('../../config/logger')(_0xcc03('0x6'));var config=require('../../config/environment');var jayson=require(_0xcc03('0x7'));var client=jayson[_0xcc03('0x8')][_0xcc03('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2977f4,_0x27099c,_0x421622){return new BPromise(function(_0x1511b9,_0x5b3a38){return client[_0xcc03('0xa')](_0x2977f4,_0x421622)[_0xcc03('0xb')](function(_0x375e9f){logger[_0xcc03('0xc')](_0xcc03('0xd'),_0x27099c,_0xcc03('0xe'));logger[_0xcc03('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x27099c,_0xcc03('0xe'),JSON['stringify'](_0x375e9f));if(_0x375e9f['error']){if(_0x375e9f[_0xcc03('0x10')]['code']===0x1f4){logger[_0xcc03('0x10')](_0xcc03('0xd'),_0x27099c,_0x375e9f['error'][_0xcc03('0x11')]);return _0x5b3a38(_0x375e9f[_0xcc03('0x10')]['message']);}logger['error'](_0xcc03('0xd'),_0x27099c,_0x375e9f[_0xcc03('0x10')][_0xcc03('0x11')]);return _0x1511b9(_0x375e9f[_0xcc03('0x10')][_0xcc03('0x11')]);}else{logger[_0xcc03('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x27099c,_0xcc03('0xe'));_0x1511b9(_0x375e9f['result'][_0xcc03('0x11')]);}})[_0xcc03('0x12')](function(_0x51ba84){logger['error'](_0xcc03('0xd'),_0x27099c,_0x51ba84);_0x5b3a38(_0x51ba84);});});}