Built motion from commit (unavailable).|2.5.15
[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 _0x6741=['message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4cae09,_0x50ca08){var _0x54d7f3=function(_0x5d0289){while(--_0x5d0289){_0x4cae09['push'](_0x4cae09['shift']());}};_0x54d7f3(++_0x50ca08);}(_0x6741,0x136));var _0x1674=function(_0x55f029,_0x1024e9){_0x55f029=_0x55f029-0x0;var _0x6c02bd=_0x6741[_0x55f029];return _0x6c02bd;};'use strict';var _=require('lodash');var util=require(_0x1674('0x0'));var moment=require(_0x1674('0x1'));var BPromise=require(_0x1674('0x2'));var rs=require(_0x1674('0x3'));var fs=require('fs');var Redis=require(_0x1674('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1674('0x5'));var logger=require(_0x1674('0x6'))(_0x1674('0x7'));var config=require(_0x1674('0x8'));var jayson=require(_0x1674('0x9'));var client=jayson['client'][_0x1674('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a29b5,_0x46531c,_0x42d8e4){return new BPromise(function(_0x735e8b,_0x17b9dd){return client[_0x1674('0xb')](_0x4a29b5,_0x42d8e4)[_0x1674('0xc')](function(_0x1d468e){logger['info'](_0x1674('0xd'),_0x46531c,_0x1674('0xe'));logger[_0x1674('0xf')](_0x1674('0x10'),_0x46531c,_0x1674('0xe'),JSON[_0x1674('0x11')](_0x1d468e));if(_0x1d468e[_0x1674('0x12')]){if(_0x1d468e[_0x1674('0x12')][_0x1674('0x13')]===0x1f4){logger['error'](_0x1674('0xd'),_0x46531c,_0x1d468e[_0x1674('0x12')][_0x1674('0x14')]);return _0x17b9dd(_0x1d468e[_0x1674('0x12')][_0x1674('0x14')]);}logger[_0x1674('0x12')](_0x1674('0xd'),_0x46531c,_0x1d468e[_0x1674('0x12')][_0x1674('0x14')]);return _0x735e8b(_0x1d468e[_0x1674('0x12')][_0x1674('0x14')]);}else{logger['info'](_0x1674('0xd'),_0x46531c,_0x1674('0xe'));_0x735e8b(_0x1d468e['result'][_0x1674('0x14')]);}})[_0x1674('0x15')](function(_0x2557b3){logger[_0x1674('0x12')](_0x1674('0xd'),_0x46531c,_0x2557b3);_0x17b9dd(_0x2557b3);});});}