Built motion from commit e781dc3c.|2.5.42
[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 _0x0b91=['code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x54587b,_0x3a0fe0){var _0x380bdb=function(_0x4d8ed7){while(--_0x4d8ed7){_0x54587b['push'](_0x54587b['shift']());}};_0x380bdb(++_0x3a0fe0);}(_0x0b91,0xca));var _0x10b9=function(_0xb0dd06,_0x114a0b){_0xb0dd06=_0xb0dd06-0x0;var _0x57fda7=_0x0b91[_0xb0dd06];return _0x57fda7;};'use strict';var _=require(_0x10b9('0x0'));var util=require(_0x10b9('0x1'));var moment=require(_0x10b9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10b9('0x3'));var db=require(_0x10b9('0x4'))['db'];var utils=require(_0x10b9('0x5'));var logger=require(_0x10b9('0x6'))(_0x10b9('0x7'));var config=require(_0x10b9('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16409c,_0x11ad09,_0x285891){return new BPromise(function(_0xc99813,_0x5a6245){return client[_0x10b9('0x9')](_0x16409c,_0x285891)['then'](function(_0x59ec6a){logger[_0x10b9('0xa')](_0x10b9('0xb'),_0x11ad09,_0x10b9('0xc'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x11ad09,_0x10b9('0xc'),JSON['stringify'](_0x59ec6a));if(_0x59ec6a[_0x10b9('0xd')]){if(_0x59ec6a[_0x10b9('0xd')][_0x10b9('0xe')]===0x1f4){logger[_0x10b9('0xd')](_0x10b9('0xb'),_0x11ad09,_0x59ec6a[_0x10b9('0xd')][_0x10b9('0xf')]);return _0x5a6245(_0x59ec6a[_0x10b9('0xd')][_0x10b9('0xf')]);}logger[_0x10b9('0xd')](_0x10b9('0xb'),_0x11ad09,_0x59ec6a[_0x10b9('0xd')][_0x10b9('0xf')]);return _0xc99813(_0x59ec6a[_0x10b9('0xd')][_0x10b9('0xf')]);}else{logger[_0x10b9('0xa')](_0x10b9('0xb'),_0x11ad09,_0x10b9('0xc'));_0xc99813(_0x59ec6a[_0x10b9('0x10')]['message']);}})[_0x10b9('0x11')](function(_0x379a48){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x11ad09,_0x379a48);_0x5a6245(_0x379a48);});});}