Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / intVtigerField / intVtigerField.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 _0xa693=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x1013f3,_0x1405e8){var _0x560ebb=function(_0x372af1){while(--_0x372af1){_0x1013f3['push'](_0x1013f3['shift']());}};_0x560ebb(++_0x1405e8);}(_0xa693,0xf1));var _0x3a69=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xa693[_0x2714ec];return _0x2608e5;};'use strict';var _=require(_0x3a69('0x0'));var util=require(_0x3a69('0x1'));var moment=require(_0x3a69('0x2'));var BPromise=require(_0x3a69('0x3'));var rs=require(_0x3a69('0x4'));var fs=require('fs');var Redis=require(_0x3a69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3a69('0x6'));var config=require(_0x3a69('0x7'));var jayson=require(_0x3a69('0x8'));var client=jayson[_0x3a69('0x9')][_0x3a69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x125226,_0x290e84,_0x5e7d90){return new BPromise(function(_0x1d564b,_0x2b8e2e){return client['request'](_0x125226,_0x5e7d90)['then'](function(_0x4e65a5){logger[_0x3a69('0xb')]('VtigerField,\x20%s,\x20%s',_0x290e84,_0x3a69('0xc'));logger[_0x3a69('0xd')](_0x3a69('0xe'),_0x290e84,_0x3a69('0xc'),JSON[_0x3a69('0xf')](_0x4e65a5));if(_0x4e65a5['error']){if(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x11')]===0x1f4){logger['error'](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x2b8e2e(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);return _0x1d564b(_0x4e65a5[_0x3a69('0x10')][_0x3a69('0x13')]);}else{logger[_0x3a69('0xb')]('VtigerField,\x20%s,\x20%s',_0x290e84,'request\x20sent');_0x1d564b(_0x4e65a5[_0x3a69('0x14')][_0x3a69('0x13')]);}})[_0x3a69('0x15')](function(_0x24fb29){logger[_0x3a69('0x10')](_0x3a69('0x12'),_0x290e84,_0x24fb29);_0x2b8e2e(_0x24fb29);});});}