Built motion from commit (unavailable).|2.5.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 _0x011e=['catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3e8dd2,_0x5d4c93){var _0x1ec0c4=function(_0xd59e93){while(--_0xd59e93){_0x3e8dd2['push'](_0x3e8dd2['shift']());}};_0x1ec0c4(++_0x5d4c93);}(_0x011e,0x85));var _0xe011=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x011e[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe011('0x0'));var util=require(_0xe011('0x1'));var moment=require(_0xe011('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe011('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe011('0x4'));var logger=require(_0xe011('0x5'))(_0xe011('0x6'));var config=require(_0xe011('0x7'));var jayson=require(_0xe011('0x8'));var client=jayson[_0xe011('0x9')][_0xe011('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5465df,_0x41cbed,_0x31210f){return new BPromise(function(_0x1ec29a,_0x254834){return client[_0xe011('0xb')](_0x5465df,_0x31210f)[_0xe011('0xc')](function(_0x20d811){logger[_0xe011('0xd')](_0xe011('0xe'),_0x41cbed,_0xe011('0xf'));logger[_0xe011('0x10')](_0xe011('0x11'),_0x41cbed,'request\x20sent',JSON['stringify'](_0x20d811));if(_0x20d811['error']){if(_0x20d811[_0xe011('0x12')][_0xe011('0x13')]===0x1f4){logger[_0xe011('0x12')](_0xe011('0xe'),_0x41cbed,_0x20d811[_0xe011('0x12')]['message']);return _0x254834(_0x20d811['error'][_0xe011('0x14')]);}logger[_0xe011('0x12')](_0xe011('0xe'),_0x41cbed,_0x20d811[_0xe011('0x12')][_0xe011('0x14')]);return _0x1ec29a(_0x20d811[_0xe011('0x12')][_0xe011('0x14')]);}else{logger[_0xe011('0xd')](_0xe011('0xe'),_0x41cbed,_0xe011('0xf'));_0x1ec29a(_0x20d811['result'][_0xe011('0x14')]);}})[_0xe011('0x15')](function(_0x4aaa28){logger['error'](_0xe011('0xe'),_0x41cbed,_0x4aaa28);_0x254834(_0x4aaa28);});});}