56fbfd41b0715f38b98383fd914c10014207a00d
[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 _0x0213=['VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x242837,_0x4703ce){var _0x182aa8=function(_0xe8456d){while(--_0xe8456d){_0x242837['push'](_0x242837['shift']());}};_0x182aa8(++_0x4703ce);}(_0x0213,0xdf));var _0x3021=function(_0x336ca2,_0x1a813a){_0x336ca2=_0x336ca2-0x0;var _0xda59a6=_0x0213[_0x336ca2];return _0xda59a6;};'use strict';var _=require(_0x3021('0x0'));var util=require(_0x3021('0x1'));var moment=require(_0x3021('0x2'));var BPromise=require(_0x3021('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3021('0x4'))['db'];var utils=require(_0x3021('0x5'));var logger=require(_0x3021('0x6'))(_0x3021('0x7'));var config=require('../../config/environment');var jayson=require(_0x3021('0x8'));var client=jayson[_0x3021('0x9')][_0x3021('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4928f3,_0x48bd76,_0x5f2f5){return new BPromise(function(_0x42efce,_0x5d6542){return client[_0x3021('0xb')](_0x4928f3,_0x5f2f5)[_0x3021('0xc')](function(_0x546050){logger[_0x3021('0xd')](_0x3021('0xe'),_0x48bd76,_0x3021('0xf'));logger[_0x3021('0x10')](_0x3021('0x11'),_0x48bd76,'request\x20sent',JSON[_0x3021('0x12')](_0x546050));if(_0x546050[_0x3021('0x13')]){if(_0x546050[_0x3021('0x13')][_0x3021('0x14')]===0x1f4){logger[_0x3021('0x13')](_0x3021('0xe'),_0x48bd76,_0x546050[_0x3021('0x13')]['message']);return _0x5d6542(_0x546050['error'][_0x3021('0x15')]);}logger['error'](_0x3021('0xe'),_0x48bd76,_0x546050['error'][_0x3021('0x15')]);return _0x42efce(_0x546050[_0x3021('0x13')][_0x3021('0x15')]);}else{logger[_0x3021('0xd')](_0x3021('0xe'),_0x48bd76,'request\x20sent');_0x42efce(_0x546050[_0x3021('0x16')][_0x3021('0x15')]);}})[_0x3021('0x17')](function(_0x150898){logger[_0x3021('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x48bd76,_0x150898);_0x5d6542(_0x150898);});});}