Built motion from commit e1760111.|2.6.18
[motion2.git] / server / api / intSugarcrmConfiguration / intSugarcrmConfiguration.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 _0x55f6=['../../config/utils','rpc','../../config/environment','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x64bfc4,_0x46d7fe){var _0x4f6d04=function(_0x4db4bd){while(--_0x4db4bd){_0x64bfc4['push'](_0x64bfc4['shift']());}};_0x4f6d04(++_0x46d7fe);}(_0x55f6,0x1ca));var _0x655f=function(_0x3a5a8d,_0x22dac9){_0x3a5a8d=_0x3a5a8d-0x0;var _0x1b94b7=_0x55f6[_0x3a5a8d];return _0x1b94b7;};'use strict';var _=require(_0x655f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x655f('0x1'));var rs=require(_0x655f('0x2'));var fs=require('fs');var Redis=require(_0x655f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x655f('0x4'));var logger=require('../../config/logger')(_0x655f('0x5'));var config=require(_0x655f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x655f('0x7')][_0x655f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f0e92,_0x4bd8a9,_0x2daa6e){return new BPromise(function(_0x553502,_0x48119f){return client[_0x655f('0x9')](_0x1f0e92,_0x2daa6e)[_0x655f('0xa')](function(_0x4d91c9){logger['info'](_0x655f('0xb'),_0x4bd8a9,_0x655f('0xc'));logger['debug'](_0x655f('0xd'),_0x4bd8a9,'request\x20sent',JSON[_0x655f('0xe')](_0x4d91c9));if(_0x4d91c9['error']){if(_0x4d91c9[_0x655f('0xf')][_0x655f('0x10')]===0x1f4){logger['error'](_0x655f('0xb'),_0x4bd8a9,_0x4d91c9[_0x655f('0xf')]['message']);return _0x48119f(_0x4d91c9[_0x655f('0xf')][_0x655f('0x11')]);}logger[_0x655f('0xf')](_0x655f('0xb'),_0x4bd8a9,_0x4d91c9[_0x655f('0xf')][_0x655f('0x11')]);return _0x553502(_0x4d91c9[_0x655f('0xf')]['message']);}else{logger[_0x655f('0x12')](_0x655f('0xb'),_0x4bd8a9,_0x655f('0xc'));_0x553502(_0x4d91c9[_0x655f('0x13')][_0x655f('0x11')]);}})[_0x655f('0x14')](function(_0x482d46){logger[_0x655f('0xf')](_0x655f('0xb'),_0x4bd8a9,_0x482d46);_0x48119f(_0x482d46);});});}