4a780c3e8f94e728b827035021ebc7a9325b403e
[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 _0x334b=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3d1163,_0x7e050d){var _0x4f5bfa=function(_0x46daff){while(--_0x46daff){_0x3d1163['push'](_0x3d1163['shift']());}};_0x4f5bfa(++_0x7e050d);}(_0x334b,0x154));var _0xb334=function(_0x2e837f,_0x4f2d93){_0x2e837f=_0x2e837f-0x0;var _0x235fb2=_0x334b[_0x2e837f];return _0x235fb2;};'use strict';var _=require('lodash');var util=require(_0xb334('0x0'));var moment=require(_0xb334('0x1'));var BPromise=require(_0xb334('0x2'));var rs=require(_0xb334('0x3'));var fs=require('fs');var Redis=require(_0xb334('0x4'));var db=require(_0xb334('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb334('0x6'))(_0xb334('0x7'));var config=require('../../config/environment');var jayson=require(_0xb334('0x8'));var client=jayson[_0xb334('0x9')][_0xb334('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52fef0,_0x39d4b,_0x39c658){return new BPromise(function(_0x408c14,_0x802d37){return client[_0xb334('0xb')](_0x52fef0,_0x39c658)[_0xb334('0xc')](function(_0x463e63){logger['info'](_0xb334('0xd'),_0x39d4b,_0xb334('0xe'));logger[_0xb334('0xf')](_0xb334('0x10'),_0x39d4b,_0xb334('0xe'),JSON[_0xb334('0x11')](_0x463e63));if(_0x463e63[_0xb334('0x12')]){if(_0x463e63[_0xb334('0x12')]['code']===0x1f4){logger[_0xb334('0x12')](_0xb334('0xd'),_0x39d4b,_0x463e63['error'][_0xb334('0x13')]);return _0x802d37(_0x463e63['error']['message']);}logger[_0xb334('0x12')](_0xb334('0xd'),_0x39d4b,_0x463e63[_0xb334('0x12')][_0xb334('0x13')]);return _0x408c14(_0x463e63[_0xb334('0x12')][_0xb334('0x13')]);}else{logger[_0xb334('0x14')](_0xb334('0xd'),_0x39d4b,_0xb334('0xe'));_0x408c14(_0x463e63[_0xb334('0x15')][_0xb334('0x13')]);}})[_0xb334('0x16')](function(_0x1dee55){logger[_0xb334('0x12')](_0xb334('0xd'),_0x39d4b,_0x1dee55);_0x802d37(_0x1dee55);});});}