Built motion from commit 43538d75.|2.5.35
[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 _0x973f=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','util'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x973f,0xaf));var _0xf973=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x973f[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0xf973('0x0'));var moment=require(_0xf973('0x1'));var BPromise=require(_0xf973('0x2'));var rs=require(_0xf973('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf973('0x4'))['db'];var utils=require(_0xf973('0x5'));var logger=require(_0xf973('0x6'))(_0xf973('0x7'));var config=require('../../config/environment');var jayson=require(_0xf973('0x8'));var client=jayson[_0xf973('0x9')][_0xf973('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe50366,_0x6eea5f,_0x44bd25){return new BPromise(function(_0x21540b,_0x14a247){return client[_0xf973('0xb')](_0xe50366,_0x44bd25)[_0xf973('0xc')](function(_0x48cf0f){logger[_0xf973('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x6eea5f,_0xf973('0xe'));logger[_0xf973('0xf')](_0xf973('0x10'),_0x6eea5f,_0xf973('0xe'),JSON['stringify'](_0x48cf0f));if(_0x48cf0f[_0xf973('0x11')]){if(_0x48cf0f[_0xf973('0x11')]['code']===0x1f4){logger[_0xf973('0x11')](_0xf973('0x12'),_0x6eea5f,_0x48cf0f['error'][_0xf973('0x13')]);return _0x14a247(_0x48cf0f[_0xf973('0x11')]['message']);}logger[_0xf973('0x11')](_0xf973('0x12'),_0x6eea5f,_0x48cf0f['error'][_0xf973('0x13')]);return _0x21540b(_0x48cf0f[_0xf973('0x11')][_0xf973('0x13')]);}else{logger[_0xf973('0xd')](_0xf973('0x12'),_0x6eea5f,_0xf973('0xe'));_0x21540b(_0x48cf0f[_0xf973('0x14')]['message']);}})[_0xf973('0x15')](function(_0x334843){logger[_0xf973('0x11')](_0xf973('0x12'),_0x6eea5f,_0x334843);_0x14a247(_0x334843);});});}