300f81357c33e1532782667526ecf384e375024f
[motion2.git] / server / api / intVtigerConfiguration / intVtigerConfiguration.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 _0x141a=['request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x141a,0x181));var _0xa141=function(_0x507b0e,_0x5e2f06){_0x507b0e=_0x507b0e-0x0;var _0x5bfd16=_0x141a[_0x507b0e];return _0x5bfd16;};'use strict';var _=require(_0xa141('0x0'));var util=require(_0xa141('0x1'));var moment=require(_0xa141('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa141('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa141('0x4'));var logger=require(_0xa141('0x5'))(_0xa141('0x6'));var config=require(_0xa141('0x7'));var jayson=require(_0xa141('0x8'));var client=jayson[_0xa141('0x9')][_0xa141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b6c,_0x4d5eab,_0x95a15c){return new BPromise(function(_0x4ad584,_0x4e53ce){return client['request'](_0x5a5b6c,_0x95a15c)[_0xa141('0xb')](function(_0x5a72ae){logger[_0xa141('0xc')](_0xa141('0xd'),_0x4d5eab,_0xa141('0xe'));logger['debug'](_0xa141('0xf'),_0x4d5eab,'request\x20sent',JSON['stringify'](_0x5a72ae));if(_0x5a72ae[_0xa141('0x10')]){if(_0x5a72ae[_0xa141('0x10')][_0xa141('0x11')]===0x1f4){logger[_0xa141('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x4d5eab,_0x5a72ae['error'][_0xa141('0x12')]);return _0x4e53ce(_0x5a72ae[_0xa141('0x10')][_0xa141('0x12')]);}logger[_0xa141('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x4d5eab,_0x5a72ae['error']['message']);return _0x4ad584(_0x5a72ae[_0xa141('0x10')]['message']);}else{logger[_0xa141('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x4d5eab,_0xa141('0xe'));_0x4ad584(_0x5a72ae[_0xa141('0x13')][_0xa141('0x12')]);}})[_0xa141('0x14')](function(_0xd72d2b){logger['error'](_0xa141('0xd'),_0x4d5eab,_0xd72d2b);_0x4e53ce(_0xd72d2b);});});}