54122f8468bfa59c497d768240723b71c3ff5cb8
[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 _0x617b=['request','then','info','request\x20sent','stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x4078cf,_0x33bcad){var _0x1b5d7e=function(_0x5f30a9){while(--_0x5f30a9){_0x4078cf['push'](_0x4078cf['shift']());}};_0x1b5d7e(++_0x33bcad);}(_0x617b,0xe7));var _0xb617=function(_0x5d3c57,_0x20d2b8){_0x5d3c57=_0x5d3c57-0x0;var _0x4be5e8=_0x617b[_0x5d3c57];return _0x4be5e8;};'use strict';var _=require(_0xb617('0x0'));var util=require('util');var moment=require(_0xb617('0x1'));var BPromise=require(_0xb617('0x2'));var rs=require(_0xb617('0x3'));var fs=require('fs');var Redis=require(_0xb617('0x4'));var db=require(_0xb617('0x5'))['db'];var utils=require(_0xb617('0x6'));var logger=require(_0xb617('0x7'))(_0xb617('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb617('0x9')][_0xb617('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59893a,_0x18a0b2,_0x2149b8){return new BPromise(function(_0x392339,_0x9dd03c){return client[_0xb617('0xb')](_0x59893a,_0x2149b8)[_0xb617('0xc')](function(_0x4fdefb){logger[_0xb617('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x18a0b2,_0xb617('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x18a0b2,_0xb617('0xe'),JSON[_0xb617('0xf')](_0x4fdefb));if(_0x4fdefb[_0xb617('0x10')]){if(_0x4fdefb['error'][_0xb617('0x11')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x18a0b2,_0x4fdefb[_0xb617('0x10')][_0xb617('0x12')]);return _0x9dd03c(_0x4fdefb[_0xb617('0x10')][_0xb617('0x12')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x18a0b2,_0x4fdefb[_0xb617('0x10')][_0xb617('0x12')]);return _0x392339(_0x4fdefb[_0xb617('0x10')][_0xb617('0x12')]);}else{logger['info'](_0xb617('0x13'),_0x18a0b2,_0xb617('0xe'));_0x392339(_0x4fdefb[_0xb617('0x14')][_0xb617('0x12')]);}})[_0xb617('0x15')](function(_0x4ebe45){logger['error'](_0xb617('0x13'),_0x18a0b2,_0x4ebe45);_0x9dd03c(_0x4ebe45);});});}