Built motion from commit 47436d59.|2.6.7
[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 _0x00b7=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UserProfileSection,\x20%s,\x20%s','info','result','catch','lodash','util'];(function(_0x14b146,_0x36c297){var _0x5cfd57=function(_0x1409f9){while(--_0x1409f9){_0x14b146['push'](_0x14b146['shift']());}};_0x5cfd57(++_0x36c297);}(_0x00b7,0x1c0));var _0x700b=function(_0xbd8ea4,_0x59d487){_0xbd8ea4=_0xbd8ea4-0x0;var _0x321769=_0x00b7[_0xbd8ea4];return _0x321769;};'use strict';var _=require(_0x700b('0x0'));var util=require(_0x700b('0x1'));var moment=require(_0x700b('0x2'));var BPromise=require(_0x700b('0x3'));var rs=require(_0x700b('0x4'));var fs=require('fs');var Redis=require(_0x700b('0x5'));var db=require(_0x700b('0x6'))['db'];var utils=require(_0x700b('0x7'));var logger=require(_0x700b('0x8'))(_0x700b('0x9'));var config=require(_0x700b('0xa'));var jayson=require(_0x700b('0xb'));var client=jayson[_0x700b('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x173182,_0x1f1101,_0x5950cd){return new BPromise(function(_0x1ea8eb,_0x31f374){return client[_0x700b('0xd')](_0x173182,_0x5950cd)[_0x700b('0xe')](function(_0x29748a){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x1f1101,'request\x20sent');logger[_0x700b('0xf')](_0x700b('0x10'),_0x1f1101,_0x700b('0x11'),JSON[_0x700b('0x12')](_0x29748a));if(_0x29748a[_0x700b('0x13')]){if(_0x29748a['error']['code']===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1f1101,_0x29748a[_0x700b('0x13')]['message']);return _0x31f374(_0x29748a[_0x700b('0x13')][_0x700b('0x14')]);}logger['error'](_0x700b('0x15'),_0x1f1101,_0x29748a[_0x700b('0x13')][_0x700b('0x14')]);return _0x1ea8eb(_0x29748a[_0x700b('0x13')][_0x700b('0x14')]);}else{logger[_0x700b('0x16')](_0x700b('0x15'),_0x1f1101,_0x700b('0x11'));_0x1ea8eb(_0x29748a[_0x700b('0x17')]['message']);}})[_0x700b('0x18')](function(_0x45db9c){logger['error'](_0x700b('0x15'),_0x1f1101,_0x45db9c);_0x31f374(_0x45db9c);});});}