Built motion from commit f67b3b02.|2.6.31
[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 _0x7027=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash'];(function(_0x4b617b,_0x39a636){var _0x3a5aa1=function(_0x4f0ffa){while(--_0x4f0ffa){_0x4b617b['push'](_0x4b617b['shift']());}};_0x3a5aa1(++_0x39a636);}(_0x7027,0x6d));var _0x7702=function(_0x4ebe2c,_0x257285){_0x4ebe2c=_0x4ebe2c-0x0;var _0x10581c=_0x7027[_0x4ebe2c];return _0x10581c;};'use strict';var _=require(_0x7702('0x0'));var util=require('util');var moment=require(_0x7702('0x1'));var BPromise=require(_0x7702('0x2'));var rs=require(_0x7702('0x3'));var fs=require('fs');var Redis=require(_0x7702('0x4'));var db=require(_0x7702('0x5'))['db'];var utils=require(_0x7702('0x6'));var logger=require('../../config/logger')(_0x7702('0x7'));var config=require(_0x7702('0x8'));var jayson=require(_0x7702('0x9'));var client=jayson[_0x7702('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcdf48c,_0x1318d3,_0x3250e5){return new BPromise(function(_0x265729,_0x534348){return client[_0x7702('0xb')](_0xcdf48c,_0x3250e5)[_0x7702('0xc')](function(_0x4b5251){logger['info'](_0x7702('0xd'),_0x1318d3,_0x7702('0xe'));logger[_0x7702('0xf')](_0x7702('0x10'),_0x1318d3,_0x7702('0xe'),JSON[_0x7702('0x11')](_0x4b5251));if(_0x4b5251[_0x7702('0x12')]){if(_0x4b5251[_0x7702('0x12')]['code']===0x1f4){logger[_0x7702('0x12')](_0x7702('0xd'),_0x1318d3,_0x4b5251[_0x7702('0x12')][_0x7702('0x13')]);return _0x534348(_0x4b5251[_0x7702('0x12')][_0x7702('0x13')]);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x1318d3,_0x4b5251[_0x7702('0x12')]['message']);return _0x265729(_0x4b5251[_0x7702('0x12')][_0x7702('0x13')]);}else{logger[_0x7702('0x14')](_0x7702('0xd'),_0x1318d3,_0x7702('0xe'));_0x265729(_0x4b5251[_0x7702('0x15')]['message']);}})['catch'](function(_0x2cca5a){logger[_0x7702('0x12')](_0x7702('0xd'),_0x1318d3,_0x2cca5a);_0x534348(_0x2cca5a);});});}