Built motion from commit 19a84241.|2.5.34
[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 _0x429a=['request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x2ed9a3,_0x108933){var _0x1d8880=function(_0x4b6f7a){while(--_0x4b6f7a){_0x2ed9a3['push'](_0x2ed9a3['shift']());}};_0x1d8880(++_0x108933);}(_0x429a,0x1a5));var _0xa429=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0x429a[_0x5af97c];return _0x3472ae;};'use strict';var _=require(_0xa429('0x0'));var util=require(_0xa429('0x1'));var moment=require(_0xa429('0x2'));var BPromise=require(_0xa429('0x3'));var rs=require(_0xa429('0x4'));var fs=require('fs');var Redis=require(_0xa429('0x5'));var db=require(_0xa429('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa429('0x7'))(_0xa429('0x8'));var config=require('../../config/environment');var jayson=require(_0xa429('0x9'));var client=jayson[_0xa429('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x566687,_0x4a6b36,_0x3caf60){return new BPromise(function(_0x4dc40c,_0x7c0ad2){return client[_0xa429('0xb')](_0x566687,_0x3caf60)[_0xa429('0xc')](function(_0x5c147e){logger['info'](_0xa429('0xd'),_0x4a6b36,_0xa429('0xe'));logger[_0xa429('0xf')](_0xa429('0x10'),_0x4a6b36,'request\x20sent',JSON[_0xa429('0x11')](_0x5c147e));if(_0x5c147e['error']){if(_0x5c147e[_0xa429('0x12')][_0xa429('0x13')]===0x1f4){logger[_0xa429('0x12')](_0xa429('0xd'),_0x4a6b36,_0x5c147e[_0xa429('0x12')][_0xa429('0x14')]);return _0x7c0ad2(_0x5c147e[_0xa429('0x12')][_0xa429('0x14')]);}logger[_0xa429('0x12')](_0xa429('0xd'),_0x4a6b36,_0x5c147e[_0xa429('0x12')][_0xa429('0x14')]);return _0x4dc40c(_0x5c147e[_0xa429('0x12')]['message']);}else{logger[_0xa429('0x15')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4a6b36,'request\x20sent');_0x4dc40c(_0x5c147e[_0xa429('0x16')]['message']);}})[_0xa429('0x17')](function(_0x65f691){logger[_0xa429('0x12')](_0xa429('0xd'),_0x4a6b36,_0x65f691);_0x7c0ad2(_0x65f691);});});}