Built motion from commit (unavailable).|2.5.13
[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 _0x968a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x968a,0x11b));var _0xa968=function(_0xa961c5,_0xdd9ef0){_0xa961c5=_0xa961c5-0x0;var _0x33e6bf=_0x968a[_0xa961c5];return _0x33e6bf;};'use strict';var _=require(_0xa968('0x0'));var util=require('util');var moment=require(_0xa968('0x1'));var BPromise=require(_0xa968('0x2'));var rs=require(_0xa968('0x3'));var fs=require('fs');var Redis=require(_0xa968('0x4'));var db=require(_0xa968('0x5'))['db'];var utils=require(_0xa968('0x6'));var logger=require(_0xa968('0x7'))(_0xa968('0x8'));var config=require(_0xa968('0x9'));var jayson=require(_0xa968('0xa'));var client=jayson[_0xa968('0xb')][_0xa968('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a2eb5,_0x4d368f,_0x1320d5){return new BPromise(function(_0x47dd2c,_0x1e31b8){return client[_0xa968('0xd')](_0x7a2eb5,_0x1320d5)['then'](function(_0x36d346){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d368f,_0xa968('0xe'));logger[_0xa968('0xf')](_0xa968('0x10'),_0x4d368f,_0xa968('0xe'),JSON[_0xa968('0x11')](_0x36d346));if(_0x36d346[_0xa968('0x12')]){if(_0x36d346[_0xa968('0x12')]['code']===0x1f4){logger[_0xa968('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d368f,_0x36d346[_0xa968('0x12')][_0xa968('0x13')]);return _0x1e31b8(_0x36d346[_0xa968('0x12')][_0xa968('0x13')]);}logger[_0xa968('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4d368f,_0x36d346[_0xa968('0x12')][_0xa968('0x13')]);return _0x47dd2c(_0x36d346[_0xa968('0x12')][_0xa968('0x13')]);}else{logger[_0xa968('0x14')](_0xa968('0x15'),_0x4d368f,_0xa968('0xe'));_0x47dd2c(_0x36d346[_0xa968('0x16')][_0xa968('0x13')]);}})[_0xa968('0x17')](function(_0x250f27){logger[_0xa968('0x12')](_0xa968('0x15'),_0x4d368f,_0x250f27);_0x1e31b8(_0x250f27);});});}