Built motion from commit 87cd5f02.|2.5.48
[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 _0x1e79=['../../config/logger','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x463241,_0x32f81b){var _0x4a7fef=function(_0x324d3c){while(--_0x324d3c){_0x463241['push'](_0x463241['shift']());}};_0x4a7fef(++_0x32f81b);}(_0x1e79,0x184));var _0x91e7=function(_0x16afae,_0x56e1eb){_0x16afae=_0x16afae-0x0;var _0x231601=_0x1e79[_0x16afae];return _0x231601;};'use strict';var _=require(_0x91e7('0x0'));var util=require(_0x91e7('0x1'));var moment=require(_0x91e7('0x2'));var BPromise=require(_0x91e7('0x3'));var rs=require(_0x91e7('0x4'));var fs=require('fs');var Redis=require(_0x91e7('0x5'));var db=require(_0x91e7('0x6'))['db'];var utils=require(_0x91e7('0x7'));var logger=require(_0x91e7('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x91e7('0x9'));var client=jayson[_0x91e7('0xa')][_0x91e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35065e,_0x2dc277,_0x6c3bbd){return new BPromise(function(_0x41a576,_0x2df387){return client['request'](_0x35065e,_0x6c3bbd)[_0x91e7('0xc')](function(_0x3f6f4b){logger[_0x91e7('0xd')](_0x91e7('0xe'),_0x2dc277,_0x91e7('0xf'));logger[_0x91e7('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2dc277,'request\x20sent',JSON['stringify'](_0x3f6f4b));if(_0x3f6f4b[_0x91e7('0x11')]){if(_0x3f6f4b[_0x91e7('0x11')][_0x91e7('0x12')]===0x1f4){logger[_0x91e7('0x11')](_0x91e7('0xe'),_0x2dc277,_0x3f6f4b[_0x91e7('0x11')][_0x91e7('0x13')]);return _0x2df387(_0x3f6f4b[_0x91e7('0x11')][_0x91e7('0x13')]);}logger[_0x91e7('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2dc277,_0x3f6f4b[_0x91e7('0x11')][_0x91e7('0x13')]);return _0x41a576(_0x3f6f4b[_0x91e7('0x11')][_0x91e7('0x13')]);}else{logger[_0x91e7('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2dc277,'request\x20sent');_0x41a576(_0x3f6f4b[_0x91e7('0x14')][_0x91e7('0x13')]);}})[_0x91e7('0x15')](function(_0x14f2fc){logger[_0x91e7('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2dc277,_0x14f2fc);_0x2df387(_0x14f2fc);});});}