Built motion from commit 9d0783e6.|2.6.13
[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 _0x72d7=['message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x75eccc,_0x4c2958){var _0x3ac04b=function(_0x271b34){while(--_0x271b34){_0x75eccc['push'](_0x75eccc['shift']());}};_0x3ac04b(++_0x4c2958);}(_0x72d7,0x129));var _0x772d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x72d7[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x772d('0x0'));var BPromise=require(_0x772d('0x1'));var rs=require(_0x772d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x772d('0x3'))['db'];var utils=require(_0x772d('0x4'));var logger=require(_0x772d('0x5'))(_0x772d('0x6'));var config=require(_0x772d('0x7'));var jayson=require(_0x772d('0x8'));var client=jayson[_0x772d('0x9')][_0x772d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x115a88,_0x371ee0,_0x379157){return new BPromise(function(_0x492da9,_0x5f4f47){return client['request'](_0x115a88,_0x379157)[_0x772d('0xb')](function(_0x397f2b){logger[_0x772d('0xc')](_0x772d('0xd'),_0x371ee0,_0x772d('0xe'));logger[_0x772d('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x371ee0,_0x772d('0xe'),JSON['stringify'](_0x397f2b));if(_0x397f2b[_0x772d('0x10')]){if(_0x397f2b['error'][_0x772d('0x11')]===0x1f4){logger[_0x772d('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x371ee0,_0x397f2b['error'][_0x772d('0x12')]);return _0x5f4f47(_0x397f2b['error'][_0x772d('0x12')]);}logger['error'](_0x772d('0xd'),_0x371ee0,_0x397f2b['error'][_0x772d('0x12')]);return _0x492da9(_0x397f2b['error'][_0x772d('0x12')]);}else{logger['info'](_0x772d('0xd'),_0x371ee0,'request\x20sent');_0x492da9(_0x397f2b[_0x772d('0x13')][_0x772d('0x12')]);}})[_0x772d('0x14')](function(_0x1b1102){logger[_0x772d('0x10')](_0x772d('0xd'),_0x371ee0,_0x1b1102);_0x5f4f47(_0x1b1102);});});}