Built motion from commit 0900f080.|2.5.45
[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 _0x06f3=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x3d17aa,_0xd68082){var _0x4154bc=function(_0x402001){while(--_0x402001){_0x3d17aa['push'](_0x3d17aa['shift']());}};_0x4154bc(++_0xd68082);}(_0x06f3,0x160));var _0x306f=function(_0x55a777,_0x2c95f7){_0x55a777=_0x55a777-0x0;var _0x8ca6a1=_0x06f3[_0x55a777];return _0x8ca6a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x306f('0x0'));var BPromise=require(_0x306f('0x1'));var rs=require(_0x306f('0x2'));var fs=require('fs');var Redis=require(_0x306f('0x3'));var db=require(_0x306f('0x4'))['db'];var utils=require(_0x306f('0x5'));var logger=require(_0x306f('0x6'))('rpc');var config=require(_0x306f('0x7'));var jayson=require(_0x306f('0x8'));var client=jayson[_0x306f('0x9')][_0x306f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15bef9,_0x21114a,_0x4d0726){return new BPromise(function(_0x3216a6,_0x2e73c1){return client['request'](_0x15bef9,_0x4d0726)[_0x306f('0xb')](function(_0x4781a7){logger[_0x306f('0xc')](_0x306f('0xd'),_0x21114a,_0x306f('0xe'));logger[_0x306f('0xf')](_0x306f('0x10'),_0x21114a,_0x306f('0xe'),JSON[_0x306f('0x11')](_0x4781a7));if(_0x4781a7[_0x306f('0x12')]){if(_0x4781a7[_0x306f('0x12')]['code']===0x1f4){logger[_0x306f('0x12')](_0x306f('0xd'),_0x21114a,_0x4781a7['error'][_0x306f('0x13')]);return _0x2e73c1(_0x4781a7[_0x306f('0x12')][_0x306f('0x13')]);}logger[_0x306f('0x12')](_0x306f('0xd'),_0x21114a,_0x4781a7[_0x306f('0x12')][_0x306f('0x13')]);return _0x3216a6(_0x4781a7[_0x306f('0x12')][_0x306f('0x13')]);}else{logger['info'](_0x306f('0xd'),_0x21114a,_0x306f('0xe'));_0x3216a6(_0x4781a7[_0x306f('0x14')][_0x306f('0x13')]);}})[_0x306f('0x15')](function(_0x59fdbf){logger['error'](_0x306f('0xd'),_0x21114a,_0x59fdbf);_0x2e73c1(_0x59fdbf);});});}