Built motion from commit da617fac.|2.6.6
[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 _0x9399=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird'];(function(_0x2a7615,_0xa23308){var _0x180173=function(_0x35ec3a){while(--_0x35ec3a){_0x2a7615['push'](_0x2a7615['shift']());}};_0x180173(++_0xa23308);}(_0x9399,0x161));var _0x9939=function(_0x1fcdbb,_0x4167bd){_0x1fcdbb=_0x1fcdbb-0x0;var _0x4d46bb=_0x9399[_0x1fcdbb];return _0x4d46bb;};'use strict';var _=require(_0x9939('0x0'));var util=require(_0x9939('0x1'));var moment=require(_0x9939('0x2'));var BPromise=require(_0x9939('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9939('0x4'));var db=require(_0x9939('0x5'))['db'];var utils=require(_0x9939('0x6'));var logger=require(_0x9939('0x7'))(_0x9939('0x8'));var config=require(_0x9939('0x9'));var jayson=require(_0x9939('0xa'));var client=jayson[_0x9939('0xb')][_0x9939('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1505d2,_0x5e40d5,_0x138ea8){return new BPromise(function(_0x5977ee,_0x37df05){return client['request'](_0x1505d2,_0x138ea8)['then'](function(_0x4695d3){logger[_0x9939('0xd')](_0x9939('0xe'),_0x5e40d5,_0x9939('0xf'));logger[_0x9939('0x10')](_0x9939('0x11'),_0x5e40d5,_0x9939('0xf'),JSON['stringify'](_0x4695d3));if(_0x4695d3[_0x9939('0x12')]){if(_0x4695d3[_0x9939('0x12')][_0x9939('0x13')]===0x1f4){logger[_0x9939('0x12')](_0x9939('0xe'),_0x5e40d5,_0x4695d3[_0x9939('0x12')]['message']);return _0x37df05(_0x4695d3[_0x9939('0x12')][_0x9939('0x14')]);}logger['error'](_0x9939('0xe'),_0x5e40d5,_0x4695d3[_0x9939('0x12')][_0x9939('0x14')]);return _0x5977ee(_0x4695d3[_0x9939('0x12')][_0x9939('0x14')]);}else{logger[_0x9939('0xd')](_0x9939('0xe'),_0x5e40d5,_0x9939('0xf'));_0x5977ee(_0x4695d3['result']['message']);}})['catch'](function(_0x4345a3){logger[_0x9939('0x12')](_0x9939('0xe'),_0x5e40d5,_0x4345a3);_0x37df05(_0x4345a3);});});}