Built motion from commit 753c950e.|2.5.42
[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 _0x6899=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x34f273,_0x37a8c3){var _0x1f2544=function(_0x1b9a6b){while(--_0x1b9a6b){_0x34f273['push'](_0x34f273['shift']());}};_0x1f2544(++_0x37a8c3);}(_0x6899,0x132));var _0x9689=function(_0x598172,_0x5c1277){_0x598172=_0x598172-0x0;var _0x255d30=_0x6899[_0x598172];return _0x255d30;};'use strict';var _=require(_0x9689('0x0'));var util=require(_0x9689('0x1'));var moment=require(_0x9689('0x2'));var BPromise=require(_0x9689('0x3'));var rs=require(_0x9689('0x4'));var fs=require('fs');var Redis=require(_0x9689('0x5'));var db=require(_0x9689('0x6'))['db'];var utils=require(_0x9689('0x7'));var logger=require(_0x9689('0x8'))(_0x9689('0x9'));var config=require('../../config/environment');var jayson=require(_0x9689('0xa'));var client=jayson[_0x9689('0xb')][_0x9689('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbcf078,_0x1c2ebe,_0x144582){return new BPromise(function(_0x244f4c,_0xbe8c9f){return client[_0x9689('0xd')](_0xbcf078,_0x144582)[_0x9689('0xe')](function(_0x377525){logger[_0x9689('0xf')](_0x9689('0x10'),_0x1c2ebe,_0x9689('0x11'));logger[_0x9689('0x12')](_0x9689('0x13'),_0x1c2ebe,_0x9689('0x11'),JSON[_0x9689('0x14')](_0x377525));if(_0x377525[_0x9689('0x15')]){if(_0x377525['error'][_0x9689('0x16')]===0x1f4){logger[_0x9689('0x15')]('VtigerField,\x20%s,\x20%s',_0x1c2ebe,_0x377525[_0x9689('0x15')]['message']);return _0xbe8c9f(_0x377525[_0x9689('0x15')][_0x9689('0x17')]);}logger[_0x9689('0x15')](_0x9689('0x10'),_0x1c2ebe,_0x377525['error'][_0x9689('0x17')]);return _0x244f4c(_0x377525[_0x9689('0x15')]['message']);}else{logger[_0x9689('0xf')]('VtigerField,\x20%s,\x20%s',_0x1c2ebe,_0x9689('0x11'));_0x244f4c(_0x377525['result'][_0x9689('0x17')]);}})[_0x9689('0x18')](function(_0x26ab12){logger[_0x9689('0x15')]('VtigerField,\x20%s,\x20%s',_0x1c2ebe,_0x26ab12);_0xbe8c9f(_0x26ab12);});});}