6a1d26703cc1b695ee06248341120d84f16670d2
[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 _0xc29b=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3ae1a9,_0x3f6243){var _0x36b7e4=function(_0x5b1fea){while(--_0x5b1fea){_0x3ae1a9['push'](_0x3ae1a9['shift']());}};_0x36b7e4(++_0x3f6243);}(_0xc29b,0x12d));var _0xbc29=function(_0x42fd35,_0x5eab3e){_0x42fd35=_0x42fd35-0x0;var _0x2975a3=_0xc29b[_0x42fd35];return _0x2975a3;};'use strict';var _=require(_0xbc29('0x0'));var util=require(_0xbc29('0x1'));var moment=require(_0xbc29('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc29('0x3'));var fs=require('fs');var Redis=require(_0xbc29('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbc29('0x5'));var logger=require(_0xbc29('0x6'))(_0xbc29('0x7'));var config=require(_0xbc29('0x8'));var jayson=require(_0xbc29('0x9'));var client=jayson[_0xbc29('0xa')][_0xbc29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40f0c9,_0x463e2b,_0x37d9dd){return new BPromise(function(_0x2e5fb7,_0x29b188){return client[_0xbc29('0xc')](_0x40f0c9,_0x37d9dd)[_0xbc29('0xd')](function(_0x320cb4){logger[_0xbc29('0xe')](_0xbc29('0xf'),_0x463e2b,_0xbc29('0x10'));logger[_0xbc29('0x11')](_0xbc29('0x12'),_0x463e2b,'request\x20sent',JSON[_0xbc29('0x13')](_0x320cb4));if(_0x320cb4[_0xbc29('0x14')]){if(_0x320cb4[_0xbc29('0x14')][_0xbc29('0x15')]===0x1f4){logger[_0xbc29('0x14')](_0xbc29('0xf'),_0x463e2b,_0x320cb4[_0xbc29('0x14')]['message']);return _0x29b188(_0x320cb4[_0xbc29('0x14')][_0xbc29('0x16')]);}logger[_0xbc29('0x14')]('VtigerField,\x20%s,\x20%s',_0x463e2b,_0x320cb4['error'][_0xbc29('0x16')]);return _0x2e5fb7(_0x320cb4['error'][_0xbc29('0x16')]);}else{logger[_0xbc29('0xe')](_0xbc29('0xf'),_0x463e2b,'request\x20sent');_0x2e5fb7(_0x320cb4[_0xbc29('0x17')]['message']);}})[_0xbc29('0x18')](function(_0x3b5bae){logger[_0xbc29('0x14')](_0xbc29('0xf'),_0x463e2b,_0x3b5bae);_0x29b188(_0x3b5bae);});});}