Built motion from commit (unavailable).|2.5.4
[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 _0x86a5=['SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a8df1,_0x44dec9){var _0x4e0733=function(_0x41a7c6){while(--_0x41a7c6){_0x2a8df1['push'](_0x2a8df1['shift']());}};_0x4e0733(++_0x44dec9);}(_0x86a5,0x174));var _0x586a=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x86a5[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x586a('0x0'));var util=require(_0x586a('0x1'));var moment=require(_0x586a('0x2'));var BPromise=require('bluebird');var rs=require(_0x586a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x586a('0x4'))['db'];var utils=require(_0x586a('0x5'));var logger=require(_0x586a('0x6'))(_0x586a('0x7'));var config=require(_0x586a('0x8'));var jayson=require(_0x586a('0x9'));var client=jayson[_0x586a('0xa')][_0x586a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e43e,_0xefc86f,_0x3a8420){return new BPromise(function(_0x112ff4,_0x293dd6){return client['request'](_0x30e43e,_0x3a8420)[_0x586a('0xc')](function(_0x1f9413){logger[_0x586a('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xefc86f,_0x586a('0xe'));logger[_0x586a('0xf')](_0x586a('0x10'),_0xefc86f,'request\x20sent',JSON[_0x586a('0x11')](_0x1f9413));if(_0x1f9413['error']){if(_0x1f9413[_0x586a('0x12')]['code']===0x1f4){logger[_0x586a('0x12')](_0x586a('0x13'),_0xefc86f,_0x1f9413['error'][_0x586a('0x14')]);return _0x293dd6(_0x1f9413[_0x586a('0x12')]['message']);}logger[_0x586a('0x12')](_0x586a('0x13'),_0xefc86f,_0x1f9413[_0x586a('0x12')][_0x586a('0x14')]);return _0x112ff4(_0x1f9413[_0x586a('0x12')][_0x586a('0x14')]);}else{logger[_0x586a('0xd')](_0x586a('0x13'),_0xefc86f,_0x586a('0xe'));_0x112ff4(_0x1f9413[_0x586a('0x15')]['message']);}})[_0x586a('0x16')](function(_0x10f55e){logger['error'](_0x586a('0x13'),_0xefc86f,_0x10f55e);_0x293dd6(_0x10f55e);});});}