Built motion from commit (unavailable).|2.5.1
[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 _0x9430=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmConfiguration,\x20%s,\x20%s','catch'];(function(_0x1e6e49,_0x38416e){var _0x488a08=function(_0x460db5){while(--_0x460db5){_0x1e6e49['push'](_0x1e6e49['shift']());}};_0x488a08(++_0x38416e);}(_0x9430,0x165));var _0x0943=function(_0x56a845,_0x2ecb45){_0x56a845=_0x56a845-0x0;var _0x346e39=_0x9430[_0x56a845];return _0x346e39;};'use strict';var _=require(_0x0943('0x0'));var util=require(_0x0943('0x1'));var moment=require(_0x0943('0x2'));var BPromise=require(_0x0943('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0943('0x4'))['db'];var utils=require(_0x0943('0x5'));var logger=require(_0x0943('0x6'))(_0x0943('0x7'));var config=require('../../config/environment');var jayson=require(_0x0943('0x8'));var client=jayson[_0x0943('0x9')][_0x0943('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ec5aa,_0x458f90,_0x15c2b9){return new BPromise(function(_0x2ddf8b,_0x8aaed5){return client['request'](_0x2ec5aa,_0x15c2b9)[_0x0943('0xb')](function(_0x3dcd42){logger[_0x0943('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x458f90,_0x0943('0xd'));logger[_0x0943('0xe')](_0x0943('0xf'),_0x458f90,_0x0943('0xd'),JSON[_0x0943('0x10')](_0x3dcd42));if(_0x3dcd42[_0x0943('0x11')]){if(_0x3dcd42['error']['code']===0x1f4){logger[_0x0943('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x458f90,_0x3dcd42[_0x0943('0x11')][_0x0943('0x12')]);return _0x8aaed5(_0x3dcd42['error'][_0x0943('0x12')]);}logger[_0x0943('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x458f90,_0x3dcd42[_0x0943('0x11')][_0x0943('0x12')]);return _0x2ddf8b(_0x3dcd42[_0x0943('0x11')][_0x0943('0x12')]);}else{logger['info'](_0x0943('0x13'),_0x458f90,_0x0943('0xd'));_0x2ddf8b(_0x3dcd42['result'][_0x0943('0x12')]);}})[_0x0943('0x14')](function(_0x4c157a){logger[_0x0943('0x11')](_0x0943('0x13'),_0x458f90,_0x4c157a);_0x8aaed5(_0x4c157a);});});}