c20afced43ce1fa27d8ba36af53563a61e757caf
[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 _0xafcd=['debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent'];(function(_0x4ceb0b,_0x5a880d){var _0xa709be=function(_0x277397){while(--_0x277397){_0x4ceb0b['push'](_0x4ceb0b['shift']());}};_0xa709be(++_0x5a880d);}(_0xafcd,0x157));var _0xdafc=function(_0x2376d1,_0x38eec4){_0x2376d1=_0x2376d1-0x0;var _0x443759=_0xafcd[_0x2376d1];return _0x443759;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var moment=require(_0xdafc('0x2'));var BPromise=require(_0xdafc('0x3'));var rs=require(_0xdafc('0x4'));var fs=require('fs');var Redis=require(_0xdafc('0x5'));var db=require(_0xdafc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdafc('0x7'))(_0xdafc('0x8'));var config=require(_0xdafc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdafc('0xa')][_0xdafc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33adc9,_0x52872c,_0x24f2e7){return new BPromise(function(_0x255125,_0x397db6){return client[_0xdafc('0xc')](_0x33adc9,_0x24f2e7)[_0xdafc('0xd')](function(_0x241787){logger[_0xdafc('0xe')](_0xdafc('0xf'),_0x52872c,_0xdafc('0x10'));logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x52872c,'request\x20sent',JSON['stringify'](_0x241787));if(_0x241787[_0xdafc('0x13')]){if(_0x241787[_0xdafc('0x13')][_0xdafc('0x14')]===0x1f4){logger[_0xdafc('0x13')](_0xdafc('0xf'),_0x52872c,_0x241787['error']['message']);return _0x397db6(_0x241787['error'][_0xdafc('0x15')]);}logger['error'](_0xdafc('0xf'),_0x52872c,_0x241787['error'][_0xdafc('0x15')]);return _0x255125(_0x241787[_0xdafc('0x13')][_0xdafc('0x15')]);}else{logger[_0xdafc('0xe')]('VtigerField,\x20%s,\x20%s',_0x52872c,'request\x20sent');_0x255125(_0x241787[_0xdafc('0x16')][_0xdafc('0x15')]);}})[_0xdafc('0x17')](function(_0x5bfac1){logger['error'](_0xdafc('0xf'),_0x52872c,_0x5bfac1);_0x397db6(_0x5bfac1);});});}