Built motion from commit ff78e754.|2.6.29
[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 _0x7432=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3d7f78,_0x17e4d0){var _0x3bf252=function(_0x2dd1c0){while(--_0x2dd1c0){_0x3d7f78['push'](_0x3d7f78['shift']());}};_0x3bf252(++_0x17e4d0);}(_0x7432,0x13e));var _0x2743=function(_0x3fe0fe,_0x4ae441){_0x3fe0fe=_0x3fe0fe-0x0;var _0x5f0f33=_0x7432[_0x3fe0fe];return _0x5f0f33;};'use strict';var _=require(_0x2743('0x0'));var util=require(_0x2743('0x1'));var moment=require(_0x2743('0x2'));var BPromise=require(_0x2743('0x3'));var rs=require(_0x2743('0x4'));var fs=require('fs');var Redis=require(_0x2743('0x5'));var db=require(_0x2743('0x6'))['db'];var utils=require(_0x2743('0x7'));var logger=require(_0x2743('0x8'))(_0x2743('0x9'));var config=require(_0x2743('0xa'));var jayson=require(_0x2743('0xb'));var client=jayson['client'][_0x2743('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x483ed5,_0x25b97c,_0x28551b){return new BPromise(function(_0x231d7f,_0x3a5616){return client[_0x2743('0xd')](_0x483ed5,_0x28551b)[_0x2743('0xe')](function(_0x2089d8){logger[_0x2743('0xf')](_0x2743('0x10'),_0x25b97c,_0x2743('0x11'));logger[_0x2743('0x12')](_0x2743('0x13'),_0x25b97c,_0x2743('0x11'),JSON[_0x2743('0x14')](_0x2089d8));if(_0x2089d8['error']){if(_0x2089d8[_0x2743('0x15')][_0x2743('0x16')]===0x1f4){logger['error'](_0x2743('0x10'),_0x25b97c,_0x2089d8['error']['message']);return _0x3a5616(_0x2089d8['error'][_0x2743('0x17')]);}logger[_0x2743('0x15')]('VtigerField,\x20%s,\x20%s',_0x25b97c,_0x2089d8['error'][_0x2743('0x17')]);return _0x231d7f(_0x2089d8['error']['message']);}else{logger['info'](_0x2743('0x10'),_0x25b97c,_0x2743('0x11'));_0x231d7f(_0x2089d8['result']['message']);}})[_0x2743('0x18')](function(_0x51266e){logger[_0x2743('0x15')](_0x2743('0x10'),_0x25b97c,_0x51266e);_0x3a5616(_0x51266e);});});}