Built motion from commit cafec4f3.|2.6.31
[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 _0xb1d2=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash'];(function(_0x58ed21,_0x52c24b){var _0x2ef891=function(_0x668ad0){while(--_0x668ad0){_0x58ed21['push'](_0x58ed21['shift']());}};_0x2ef891(++_0x52c24b);}(_0xb1d2,0xdf));var _0x2b1d=function(_0x1ed64c,_0x47a758){_0x1ed64c=_0x1ed64c-0x0;var _0x3611ec=_0xb1d2[_0x1ed64c];return _0x3611ec;};'use strict';var _=require(_0x2b1d('0x0'));var util=require('util');var moment=require(_0x2b1d('0x1'));var BPromise=require(_0x2b1d('0x2'));var rs=require(_0x2b1d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b1d('0x4'))['db'];var utils=require(_0x2b1d('0x5'));var logger=require('../../config/logger')(_0x2b1d('0x6'));var config=require('../../config/environment');var jayson=require(_0x2b1d('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12e17b,_0x3130e6,_0x430d28){return new BPromise(function(_0x38c1e6,_0x311a0c){return client['request'](_0x12e17b,_0x430d28)['then'](function(_0x312943){logger[_0x2b1d('0x8')](_0x2b1d('0x9'),_0x3130e6,_0x2b1d('0xa'));logger[_0x2b1d('0xb')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3130e6,'request\x20sent',JSON['stringify'](_0x312943));if(_0x312943[_0x2b1d('0xc')]){if(_0x312943[_0x2b1d('0xc')][_0x2b1d('0xd')]===0x1f4){logger['error'](_0x2b1d('0x9'),_0x3130e6,_0x312943[_0x2b1d('0xc')][_0x2b1d('0xe')]);return _0x311a0c(_0x312943['error'][_0x2b1d('0xe')]);}logger[_0x2b1d('0xc')](_0x2b1d('0x9'),_0x3130e6,_0x312943[_0x2b1d('0xc')][_0x2b1d('0xe')]);return _0x38c1e6(_0x312943[_0x2b1d('0xc')][_0x2b1d('0xe')]);}else{logger[_0x2b1d('0x8')](_0x2b1d('0x9'),_0x3130e6,_0x2b1d('0xa'));_0x38c1e6(_0x312943[_0x2b1d('0xf')]['message']);}})['catch'](function(_0x3e5d54){logger[_0x2b1d('0xc')](_0x2b1d('0x9'),_0x3130e6,_0x3e5d54);_0x311a0c(_0x3e5d54);});});}