fdf8998408c566799a614fe38cd3d3ad84f924da
[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 _0xf264=['../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','ioredis'];(function(_0x152d9d,_0x5720ec){var _0xe45d69=function(_0x4b7055){while(--_0x4b7055){_0x152d9d['push'](_0x152d9d['shift']());}};_0xe45d69(++_0x5720ec);}(_0xf264,0x1dc));var _0x4f26=function(_0x3d2ebd,_0xb7b4c4){_0x3d2ebd=_0x3d2ebd-0x0;var _0x50132c=_0xf264[_0x3d2ebd];return _0x50132c;};'use strict';var _=require(_0x4f26('0x0'));var util=require(_0x4f26('0x1'));var moment=require('moment');var BPromise=require(_0x4f26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f26('0x3'));var db=require(_0x4f26('0x4'))['db'];var utils=require(_0x4f26('0x5'));var logger=require('../../config/logger')(_0x4f26('0x6'));var config=require(_0x4f26('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x59df33,_0x405957,_0x115e2e){return new BPromise(function(_0x5c32b2,_0x233c65){return client[_0x4f26('0x9')](_0x59df33,_0x115e2e)[_0x4f26('0xa')](function(_0x706e9b){logger['info'](_0x4f26('0xb'),_0x405957,_0x4f26('0xc'));logger['debug'](_0x4f26('0xd'),_0x405957,_0x4f26('0xc'),JSON['stringify'](_0x706e9b));if(_0x706e9b['error']){if(_0x706e9b[_0x4f26('0xe')][_0x4f26('0xf')]===0x1f4){logger['error'](_0x4f26('0xb'),_0x405957,_0x706e9b[_0x4f26('0xe')][_0x4f26('0x10')]);return _0x233c65(_0x706e9b[_0x4f26('0xe')]['message']);}logger['error'](_0x4f26('0xb'),_0x405957,_0x706e9b['error']['message']);return _0x5c32b2(_0x706e9b['error']['message']);}else{logger[_0x4f26('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x405957,_0x4f26('0xc'));_0x5c32b2(_0x706e9b[_0x4f26('0x12')][_0x4f26('0x10')]);}})[_0x4f26('0x13')](function(_0x258eb0){logger[_0x4f26('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x405957,_0x258eb0);_0x233c65(_0x258eb0);});});}