Built motion from commit 2e4747fd.|2.6.7
[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 _0xd87a=['request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3d1304,_0x2d258d){var _0x3cf0ec=function(_0x37e3dd){while(--_0x37e3dd){_0x3d1304['push'](_0x3d1304['shift']());}};_0x3cf0ec(++_0x2d258d);}(_0xd87a,0x1bf));var _0xad87=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xd87a[_0x28394f];return _0x2618d2;};'use strict';var _=require('lodash');var util=require(_0xad87('0x0'));var moment=require(_0xad87('0x1'));var BPromise=require('bluebird');var rs=require(_0xad87('0x2'));var fs=require('fs');var Redis=require(_0xad87('0x3'));var db=require(_0xad87('0x4'))['db'];var utils=require(_0xad87('0x5'));var logger=require(_0xad87('0x6'))(_0xad87('0x7'));var config=require('../../config/environment');var jayson=require(_0xad87('0x8'));var client=jayson[_0xad87('0x9')][_0xad87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x599c59,_0x2dc077,_0x213e14){return new BPromise(function(_0x3c93fe,_0x23817e){return client['request'](_0x599c59,_0x213e14)[_0xad87('0xb')](function(_0x2a19bd){logger[_0xad87('0xc')](_0xad87('0xd'),_0x2dc077,'request\x20sent');logger['debug'](_0xad87('0xe'),_0x2dc077,_0xad87('0xf'),JSON[_0xad87('0x10')](_0x2a19bd));if(_0x2a19bd[_0xad87('0x11')]){if(_0x2a19bd[_0xad87('0x11')][_0xad87('0x12')]===0x1f4){logger[_0xad87('0x11')](_0xad87('0xd'),_0x2dc077,_0x2a19bd[_0xad87('0x11')][_0xad87('0x13')]);return _0x23817e(_0x2a19bd[_0xad87('0x11')][_0xad87('0x13')]);}logger[_0xad87('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2dc077,_0x2a19bd[_0xad87('0x11')][_0xad87('0x13')]);return _0x3c93fe(_0x2a19bd[_0xad87('0x11')][_0xad87('0x13')]);}else{logger['info'](_0xad87('0xd'),_0x2dc077,'request\x20sent');_0x3c93fe(_0x2a19bd[_0xad87('0x14')][_0xad87('0x13')]);}})[_0xad87('0x15')](function(_0x1c0d5b){logger[_0xad87('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2dc077,_0x1c0d5b);_0x23817e(_0x1c0d5b);});});}