Built motion from commit b5a10faa.|2.6.13
[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 _0x5f51=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VtigerField,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5f51,0x9d));var _0x15f5=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5f51[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x15f5('0x0'));var util=require(_0x15f5('0x1'));var moment=require(_0x15f5('0x2'));var BPromise=require(_0x15f5('0x3'));var rs=require(_0x15f5('0x4'));var fs=require('fs');var Redis=require(_0x15f5('0x5'));var db=require(_0x15f5('0x6'))['db'];var utils=require(_0x15f5('0x7'));var logger=require(_0x15f5('0x8'))(_0x15f5('0x9'));var config=require(_0x15f5('0xa'));var jayson=require(_0x15f5('0xb'));var client=jayson[_0x15f5('0xc')][_0x15f5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x19e9fd,_0x38f3c6,_0x548e14){return new BPromise(function(_0x3d7a8a,_0x59bc87){return client[_0x15f5('0xe')](_0x19e9fd,_0x548e14)[_0x15f5('0xf')](function(_0x1eb788){logger[_0x15f5('0x10')]('VtigerField,\x20%s,\x20%s',_0x38f3c6,_0x15f5('0x11'));logger['debug'](_0x15f5('0x12'),_0x38f3c6,_0x15f5('0x11'),JSON[_0x15f5('0x13')](_0x1eb788));if(_0x1eb788[_0x15f5('0x14')]){if(_0x1eb788['error'][_0x15f5('0x15')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x38f3c6,_0x1eb788[_0x15f5('0x14')][_0x15f5('0x16')]);return _0x59bc87(_0x1eb788[_0x15f5('0x14')]['message']);}logger['error'](_0x15f5('0x17'),_0x38f3c6,_0x1eb788[_0x15f5('0x14')][_0x15f5('0x16')]);return _0x3d7a8a(_0x1eb788[_0x15f5('0x14')][_0x15f5('0x16')]);}else{logger[_0x15f5('0x10')](_0x15f5('0x17'),_0x38f3c6,'request\x20sent');_0x3d7a8a(_0x1eb788[_0x15f5('0x18')][_0x15f5('0x16')]);}})['catch'](function(_0x43eae7){logger['error']('VtigerField,\x20%s,\x20%s',_0x38f3c6,_0x43eae7);_0x59bc87(_0x43eae7);});});}