Built motion from commit 092f8824.|2.5.49
[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 _0xd883=['../../config/logger','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x39979b,_0x2111f9){var _0x560b41=function(_0x859cc0){while(--_0x859cc0){_0x39979b['push'](_0x39979b['shift']());}};_0x560b41(++_0x2111f9);}(_0xd883,0x117));var _0x3d88=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xd883[_0x5d2803];return _0xdcad2c;};'use strict';var _=require('lodash');var util=require(_0x3d88('0x0'));var moment=require(_0x3d88('0x1'));var BPromise=require(_0x3d88('0x2'));var rs=require(_0x3d88('0x3'));var fs=require('fs');var Redis=require(_0x3d88('0x4'));var db=require(_0x3d88('0x5'))['db'];var utils=require(_0x3d88('0x6'));var logger=require(_0x3d88('0x7'))('rpc');var config=require(_0x3d88('0x8'));var jayson=require(_0x3d88('0x9'));var client=jayson[_0x3d88('0xa')][_0x3d88('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25c3f2,_0xe06db6,_0x72042b){return new BPromise(function(_0x4f8b92,_0x797649){return client[_0x3d88('0xc')](_0x25c3f2,_0x72042b)['then'](function(_0xf8e5e9){logger[_0x3d88('0xd')](_0x3d88('0xe'),_0xe06db6,_0x3d88('0xf'));logger[_0x3d88('0x10')]('VtigerField,\x20%s,\x20%s,\x20%s',_0xe06db6,_0x3d88('0xf'),JSON[_0x3d88('0x11')](_0xf8e5e9));if(_0xf8e5e9[_0x3d88('0x12')]){if(_0xf8e5e9[_0x3d88('0x12')][_0x3d88('0x13')]===0x1f4){logger[_0x3d88('0x12')](_0x3d88('0xe'),_0xe06db6,_0xf8e5e9[_0x3d88('0x12')][_0x3d88('0x14')]);return _0x797649(_0xf8e5e9[_0x3d88('0x12')][_0x3d88('0x14')]);}logger['error'](_0x3d88('0xe'),_0xe06db6,_0xf8e5e9['error'][_0x3d88('0x14')]);return _0x4f8b92(_0xf8e5e9[_0x3d88('0x12')][_0x3d88('0x14')]);}else{logger['info'](_0x3d88('0xe'),_0xe06db6,_0x3d88('0xf'));_0x4f8b92(_0xf8e5e9['result']['message']);}})[_0x3d88('0x15')](function(_0x200b2f){logger['error'](_0x3d88('0xe'),_0xe06db6,_0x200b2f);_0x797649(_0x200b2f);});});}