1949f190a22b6875480573475b6278e3d7f92131
[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 _0xeb98=['client','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xeb98,0x1aa));var _0x8eb9=function(_0x2b5382,_0x180a90){_0x2b5382=_0x2b5382-0x0;var _0x54a288=_0xeb98[_0x2b5382];return _0x54a288;};'use strict';var _=require(_0x8eb9('0x0'));var util=require(_0x8eb9('0x1'));var moment=require(_0x8eb9('0x2'));var BPromise=require(_0x8eb9('0x3'));var rs=require(_0x8eb9('0x4'));var fs=require('fs');var Redis=require(_0x8eb9('0x5'));var db=require(_0x8eb9('0x6'))['db'];var utils=require(_0x8eb9('0x7'));var logger=require(_0x8eb9('0x8'))('rpc');var config=require(_0x8eb9('0x9'));var jayson=require(_0x8eb9('0xa'));var client=jayson[_0x8eb9('0xb')][_0x8eb9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x103229,_0x431489,_0x4de9ed){return new BPromise(function(_0x29f55d,_0x3e1778){return client[_0x8eb9('0xd')](_0x103229,_0x4de9ed)['then'](function(_0x5e29c5){logger['info'](_0x8eb9('0xe'),_0x431489,_0x8eb9('0xf'));logger[_0x8eb9('0x10')](_0x8eb9('0x11'),_0x431489,_0x8eb9('0xf'),JSON[_0x8eb9('0x12')](_0x5e29c5));if(_0x5e29c5[_0x8eb9('0x13')]){if(_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x14')]===0x1f4){logger[_0x8eb9('0x13')](_0x8eb9('0xe'),_0x431489,_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x15')]);return _0x3e1778(_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x15')]);}logger['error'](_0x8eb9('0xe'),_0x431489,_0x5e29c5['error'][_0x8eb9('0x15')]);return _0x29f55d(_0x5e29c5[_0x8eb9('0x13')][_0x8eb9('0x15')]);}else{logger[_0x8eb9('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x431489,_0x8eb9('0xf'));_0x29f55d(_0x5e29c5['result']['message']);}})['catch'](function(_0x16805c){logger[_0x8eb9('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x431489,_0x16805c);_0x3e1778(_0x16805c);});});}