Built motion from commit 5b761a7b.|2.5.36
[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 _0x42ca=['stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s'];(function(_0x468ccd,_0x575b8a){var _0x52a7d1=function(_0x1d9ba7){while(--_0x1d9ba7){_0x468ccd['push'](_0x468ccd['shift']());}};_0x52a7d1(++_0x575b8a);}(_0x42ca,0xad));var _0xa42c=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0x42ca[_0x27eda0];return _0x2b63a5;};'use strict';var _=require(_0xa42c('0x0'));var util=require(_0xa42c('0x1'));var moment=require(_0xa42c('0x2'));var BPromise=require(_0xa42c('0x3'));var rs=require(_0xa42c('0x4'));var fs=require('fs');var Redis=require(_0xa42c('0x5'));var db=require(_0xa42c('0x6'))['db'];var utils=require(_0xa42c('0x7'));var logger=require(_0xa42c('0x8'))('rpc');var config=require(_0xa42c('0x9'));var jayson=require(_0xa42c('0xa'));var client=jayson[_0xa42c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ba9a,_0x34abb1,_0x528f17){return new BPromise(function(_0x4c4a7d,_0x25c240){return client[_0xa42c('0xc')](_0x41ba9a,_0x528f17)[_0xa42c('0xd')](function(_0x323a19){logger[_0xa42c('0xe')](_0xa42c('0xf'),_0x34abb1,_0xa42c('0x10'));logger[_0xa42c('0x11')](_0xa42c('0x12'),_0x34abb1,'request\x20sent',JSON[_0xa42c('0x13')](_0x323a19));if(_0x323a19[_0xa42c('0x14')]){if(_0x323a19[_0xa42c('0x14')][_0xa42c('0x15')]===0x1f4){logger[_0xa42c('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x34abb1,_0x323a19[_0xa42c('0x14')]['message']);return _0x25c240(_0x323a19[_0xa42c('0x14')][_0xa42c('0x16')]);}logger[_0xa42c('0x14')](_0xa42c('0xf'),_0x34abb1,_0x323a19[_0xa42c('0x14')]['message']);return _0x4c4a7d(_0x323a19[_0xa42c('0x14')][_0xa42c('0x16')]);}else{logger['info'](_0xa42c('0xf'),_0x34abb1,_0xa42c('0x10'));_0x4c4a7d(_0x323a19['result'][_0xa42c('0x16')]);}})[_0xa42c('0x17')](function(_0x83c04){logger[_0xa42c('0x14')](_0xa42c('0xf'),_0x34abb1,_0x83c04);_0x25c240(_0x83c04);});});}