Built motion from commit 67e5df37.|2.0.66
[motion2.git] / server / api / intSugarcrmField / intSugarcrmField.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 _0x92cd=['http','request','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x1b32fe,_0x244cb4){var _0x472bfc=function(_0x3092e6){while(--_0x3092e6){_0x1b32fe['push'](_0x1b32fe['shift']());}};_0x472bfc(++_0x244cb4);}(_0x92cd,0x1f1));var _0xd92c=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x92cd[_0x346737];return _0x1ade2e;};'use strict';var _=require(_0xd92c('0x0'));var util=require(_0xd92c('0x1'));var moment=require(_0xd92c('0x2'));var BPromise=require(_0xd92c('0x3'));var rs=require(_0xd92c('0x4'));var fs=require('fs');var db=require(_0xd92c('0x5'))['db'];var utils=require(_0xd92c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd92c('0x7'));var jayson=require(_0xd92c('0x8'));var client=jayson['client'][_0xd92c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2027a2,_0xba1e18,_0x2ba63e){return new BPromise(function(_0x3d3814,_0x414acb){return client[_0xd92c('0xa')](_0x2027a2,_0x2ba63e)[_0xd92c('0xb')](function(_0xbc2765){logger[_0xd92c('0xc')]('SugarcrmField,\x20%s,\x20%s',_0xba1e18,_0xd92c('0xd'));logger[_0xd92c('0xe')](_0xd92c('0xf'),_0xba1e18,_0xd92c('0xd'),JSON[_0xd92c('0x10')](_0xbc2765));if(_0xbc2765['error']){if(_0xbc2765[_0xd92c('0x11')][_0xd92c('0x12')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0xba1e18,_0xbc2765['error']['message']);return _0x414acb(_0xbc2765[_0xd92c('0x11')][_0xd92c('0x13')]);}logger[_0xd92c('0x11')](_0xd92c('0x14'),_0xba1e18,_0xbc2765[_0xd92c('0x11')]['message']);return _0x3d3814(_0xbc2765[_0xd92c('0x11')]['message']);}else{logger[_0xd92c('0xc')](_0xd92c('0x14'),_0xba1e18,'request\x20sent');_0x3d3814(_0xbc2765[_0xd92c('0x15')][_0xd92c('0x13')]);}})[_0xd92c('0x16')](function(_0x38e88a){logger[_0xd92c('0x11')]('SugarcrmField,\x20%s,\x20%s',_0xba1e18,_0x38e88a);_0x414acb(_0x38e88a);});});}