Built motion from commit c738b9ac.|2.6.25
[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 _0x8be3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','randomstring'];(function(_0x327aa5,_0x3f5253){var _0x500eaf=function(_0x1fe8d4){while(--_0x1fe8d4){_0x327aa5['push'](_0x327aa5['shift']());}};_0x500eaf(++_0x3f5253);}(_0x8be3,0xe3));var _0x38be=function(_0x21d5fa,_0x29e8dd){_0x21d5fa=_0x21d5fa-0x0;var _0x22d714=_0x8be3[_0x21d5fa];return _0x22d714;};'use strict';var _=require('lodash');var util=require(_0x38be('0x0'));var moment=require('moment');var BPromise=require(_0x38be('0x1'));var rs=require(_0x38be('0x2'));var fs=require('fs');var Redis=require(_0x38be('0x3'));var db=require(_0x38be('0x4'))['db'];var utils=require(_0x38be('0x5'));var logger=require(_0x38be('0x6'))('rpc');var config=require(_0x38be('0x7'));var jayson=require(_0x38be('0x8'));var client=jayson[_0x38be('0x9')][_0x38be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa83ef0,_0xaddace,_0x34daca){return new BPromise(function(_0x37dcd1,_0x300795){return client[_0x38be('0xb')](_0xa83ef0,_0x34daca)[_0x38be('0xc')](function(_0x221f2c){logger[_0x38be('0xd')](_0x38be('0xe'),_0xaddace,_0x38be('0xf'));logger[_0x38be('0x10')](_0x38be('0x11'),_0xaddace,'request\x20sent',JSON[_0x38be('0x12')](_0x221f2c));if(_0x221f2c[_0x38be('0x13')]){if(_0x221f2c[_0x38be('0x13')]['code']===0x1f4){logger[_0x38be('0x13')]('UserProfileSection,\x20%s,\x20%s',_0xaddace,_0x221f2c[_0x38be('0x13')][_0x38be('0x14')]);return _0x300795(_0x221f2c[_0x38be('0x13')][_0x38be('0x14')]);}logger['error'](_0x38be('0xe'),_0xaddace,_0x221f2c[_0x38be('0x13')][_0x38be('0x14')]);return _0x37dcd1(_0x221f2c['error'][_0x38be('0x14')]);}else{logger[_0x38be('0xd')](_0x38be('0xe'),_0xaddace,_0x38be('0xf'));_0x37dcd1(_0x221f2c[_0x38be('0x15')]['message']);}})[_0x38be('0x16')](function(_0x5b20eb){logger[_0x38be('0x13')]('UserProfileSection,\x20%s,\x20%s',_0xaddace,_0x5b20eb);_0x300795(_0x5b20eb);});});}