23bc62d292926d256b89637e719166ab88fb3fe6
[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 _0x698c=['../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x698c,0xf3));var _0xc698=function(_0x2a0851,_0xd7a9ac){_0x2a0851=_0x2a0851-0x0;var _0x4430cc=_0x698c[_0x2a0851];return _0x4430cc;};'use strict';var _=require(_0xc698('0x0'));var util=require(_0xc698('0x1'));var moment=require(_0xc698('0x2'));var BPromise=require(_0xc698('0x3'));var rs=require(_0xc698('0x4'));var fs=require('fs');var Redis=require(_0xc698('0x5'));var db=require(_0xc698('0x6'))['db'];var utils=require(_0xc698('0x7'));var logger=require(_0xc698('0x8'))(_0xc698('0x9'));var config=require(_0xc698('0xa'));var jayson=require(_0xc698('0xb'));var client=jayson['client'][_0xc698('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9ac0cc,_0x39dde5,_0xbc89f0){return new BPromise(function(_0x158668,_0x481bc4){return client[_0xc698('0xd')](_0x9ac0cc,_0xbc89f0)[_0xc698('0xe')](function(_0x4aef95){logger[_0xc698('0xf')](_0xc698('0x10'),_0x39dde5,'request\x20sent');logger[_0xc698('0x11')](_0xc698('0x12'),_0x39dde5,_0xc698('0x13'),JSON['stringify'](_0x4aef95));if(_0x4aef95['error']){if(_0x4aef95[_0xc698('0x14')]['code']===0x1f4){logger[_0xc698('0x14')]('VtigerField,\x20%s,\x20%s',_0x39dde5,_0x4aef95['error'][_0xc698('0x15')]);return _0x481bc4(_0x4aef95['error'][_0xc698('0x15')]);}logger['error'](_0xc698('0x10'),_0x39dde5,_0x4aef95['error'][_0xc698('0x15')]);return _0x158668(_0x4aef95[_0xc698('0x14')][_0xc698('0x15')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x39dde5,_0xc698('0x13'));_0x158668(_0x4aef95['result'][_0xc698('0x15')]);}})[_0xc698('0x16')](function(_0x38f739){logger[_0xc698('0x14')]('VtigerField,\x20%s,\x20%s',_0x39dde5,_0x38f739);_0x481bc4(_0x38f739);});});}