Built motion from commit 52c8a02d.|2.6.29
[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 _0xa72f=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4e3dd5,_0x44d2c4){var _0x4025b8=function(_0x120707){while(--_0x120707){_0x4e3dd5['push'](_0x4e3dd5['shift']());}};_0x4025b8(++_0x44d2c4);}(_0xa72f,0x170));var _0xfa72=function(_0x64b31d,_0x393b36){_0x64b31d=_0x64b31d-0x0;var _0x42c45b=_0xa72f[_0x64b31d];return _0x42c45b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa72('0x0'));var BPromise=require(_0xfa72('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa72('0x2'));var db=require(_0xfa72('0x3'))['db'];var utils=require(_0xfa72('0x4'));var logger=require('../../config/logger')(_0xfa72('0x5'));var config=require(_0xfa72('0x6'));var jayson=require(_0xfa72('0x7'));var client=jayson[_0xfa72('0x8')][_0xfa72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13427b,_0x5e457b,_0x3c692e){return new BPromise(function(_0x24ab42,_0x3fd34f){return client[_0xfa72('0xa')](_0x13427b,_0x3c692e)[_0xfa72('0xb')](function(_0x4e0f2f){logger[_0xfa72('0xc')](_0xfa72('0xd'),_0x5e457b,_0xfa72('0xe'));logger[_0xfa72('0xf')](_0xfa72('0x10'),_0x5e457b,_0xfa72('0xe'),JSON[_0xfa72('0x11')](_0x4e0f2f));if(_0x4e0f2f[_0xfa72('0x12')]){if(_0x4e0f2f[_0xfa72('0x12')][_0xfa72('0x13')]===0x1f4){logger[_0xfa72('0x12')](_0xfa72('0xd'),_0x5e457b,_0x4e0f2f[_0xfa72('0x12')][_0xfa72('0x14')]);return _0x3fd34f(_0x4e0f2f[_0xfa72('0x12')]['message']);}logger[_0xfa72('0x12')](_0xfa72('0xd'),_0x5e457b,_0x4e0f2f[_0xfa72('0x12')][_0xfa72('0x14')]);return _0x24ab42(_0x4e0f2f[_0xfa72('0x12')][_0xfa72('0x14')]);}else{logger[_0xfa72('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x5e457b,'request\x20sent');_0x24ab42(_0x4e0f2f[_0xfa72('0x15')][_0xfa72('0x14')]);}})[_0xfa72('0x16')](function(_0x494b33){logger[_0xfa72('0x12')](_0xfa72('0xd'),_0x5e457b,_0x494b33);_0x3fd34f(_0x494b33);});});}