Built motion from commit (unavailable).|2.5.5
[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 _0xe458=['error','code','message','VtigerField,\x20%s,\x20%s','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3a5714,_0x4a3d19){var _0x421da5=function(_0x5a4206){while(--_0x5a4206){_0x3a5714['push'](_0x3a5714['shift']());}};_0x421da5(++_0x4a3d19);}(_0xe458,0x160));var _0x8e45=function(_0x2abe73,_0x53fcef){_0x2abe73=_0x2abe73-0x0;var _0x158226=_0xe458[_0x2abe73];return _0x158226;};'use strict';var _=require(_0x8e45('0x0'));var util=require(_0x8e45('0x1'));var moment=require('moment');var BPromise=require(_0x8e45('0x2'));var rs=require(_0x8e45('0x3'));var fs=require('fs');var Redis=require(_0x8e45('0x4'));var db=require(_0x8e45('0x5'))['db'];var utils=require(_0x8e45('0x6'));var logger=require(_0x8e45('0x7'))(_0x8e45('0x8'));var config=require(_0x8e45('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8e45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a92a1,_0x3a646f,_0x37cde4){return new BPromise(function(_0x27433a,_0x1f60da){return client[_0x8e45('0xb')](_0x3a92a1,_0x37cde4)['then'](function(_0x59886a){logger['info']('VtigerField,\x20%s,\x20%s',_0x3a646f,_0x8e45('0xc'));logger[_0x8e45('0xd')](_0x8e45('0xe'),_0x3a646f,'request\x20sent',JSON[_0x8e45('0xf')](_0x59886a));if(_0x59886a[_0x8e45('0x10')]){if(_0x59886a['error'][_0x8e45('0x11')]===0x1f4){logger[_0x8e45('0x10')]('VtigerField,\x20%s,\x20%s',_0x3a646f,_0x59886a[_0x8e45('0x10')][_0x8e45('0x12')]);return _0x1f60da(_0x59886a['error'][_0x8e45('0x12')]);}logger[_0x8e45('0x10')](_0x8e45('0x13'),_0x3a646f,_0x59886a['error'][_0x8e45('0x12')]);return _0x27433a(_0x59886a[_0x8e45('0x10')][_0x8e45('0x12')]);}else{logger[_0x8e45('0x14')](_0x8e45('0x13'),_0x3a646f,_0x8e45('0xc'));_0x27433a(_0x59886a[_0x8e45('0x15')][_0x8e45('0x12')]);}})[_0x8e45('0x16')](function(_0x23071d){logger[_0x8e45('0x10')](_0x8e45('0x13'),_0x3a646f,_0x23071d);_0x1f60da(_0x23071d);});});}