395e78c13fd07365ef1e9f076961af43cda0502d
[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 _0x1816=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent'];(function(_0x568bd7,_0x23eea6){var _0x203cda=function(_0x26d94f){while(--_0x26d94f){_0x568bd7['push'](_0x568bd7['shift']());}};_0x203cda(++_0x23eea6);}(_0x1816,0x1ab));var _0x6181=function(_0x11401c,_0x48cb45){_0x11401c=_0x11401c-0x0;var _0x1d663b=_0x1816[_0x11401c];return _0x1d663b;};'use strict';var _=require(_0x6181('0x0'));var util=require(_0x6181('0x1'));var moment=require(_0x6181('0x2'));var BPromise=require(_0x6181('0x3'));var rs=require(_0x6181('0x4'));var fs=require('fs');var Redis=require(_0x6181('0x5'));var db=require(_0x6181('0x6'))['db'];var utils=require(_0x6181('0x7'));var logger=require('../../config/logger')(_0x6181('0x8'));var config=require(_0x6181('0x9'));var jayson=require(_0x6181('0xa'));var client=jayson[_0x6181('0xb')][_0x6181('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21f056,_0x4181d8,_0x261e5d){return new BPromise(function(_0x5b5c86,_0x496cb0){return client[_0x6181('0xd')](_0x21f056,_0x261e5d)[_0x6181('0xe')](function(_0x4245f5){logger[_0x6181('0xf')](_0x6181('0x10'),_0x4181d8,'request\x20sent');logger[_0x6181('0x11')](_0x6181('0x12'),_0x4181d8,'request\x20sent',JSON[_0x6181('0x13')](_0x4245f5));if(_0x4245f5[_0x6181('0x14')]){if(_0x4245f5[_0x6181('0x14')]['code']===0x1f4){logger['error'](_0x6181('0x10'),_0x4181d8,_0x4245f5[_0x6181('0x14')][_0x6181('0x15')]);return _0x496cb0(_0x4245f5[_0x6181('0x14')][_0x6181('0x15')]);}logger[_0x6181('0x14')](_0x6181('0x10'),_0x4181d8,_0x4245f5['error']['message']);return _0x5b5c86(_0x4245f5[_0x6181('0x14')][_0x6181('0x15')]);}else{logger[_0x6181('0xf')](_0x6181('0x10'),_0x4181d8,_0x6181('0x16'));_0x5b5c86(_0x4245f5[_0x6181('0x17')][_0x6181('0x15')]);}})[_0x6181('0x18')](function(_0x1a3551){logger[_0x6181('0x14')](_0x6181('0x10'),_0x4181d8,_0x1a3551);_0x496cb0(_0x1a3551);});});}