Built motion from commit a61a4a20.|2.5.46
[motion2.git] / server / api / intSalesforceConfiguration / intSalesforceConfiguration.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 _0x2b29=['SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x52cd3c,_0x4aa698){var _0x308251=function(_0x4d55dc){while(--_0x4d55dc){_0x52cd3c['push'](_0x52cd3c['shift']());}};_0x308251(++_0x4aa698);}(_0x2b29,0xd8));var _0x92b2=function(_0x30659a,_0xd54b22){_0x30659a=_0x30659a-0x0;var _0xf0fcf=_0x2b29[_0x30659a];return _0xf0fcf;};'use strict';var _=require(_0x92b2('0x0'));var util=require(_0x92b2('0x1'));var moment=require(_0x92b2('0x2'));var BPromise=require(_0x92b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92b2('0x4'));var db=require(_0x92b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92b2('0x6'))(_0x92b2('0x7'));var config=require(_0x92b2('0x8'));var jayson=require(_0x92b2('0x9'));var client=jayson[_0x92b2('0xa')][_0x92b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d45c0,_0x3c7766,_0x3b7e77){return new BPromise(function(_0x14571e,_0x3d8d33){return client[_0x92b2('0xc')](_0x2d45c0,_0x3b7e77)['then'](function(_0x21b19d){logger[_0x92b2('0xd')](_0x92b2('0xe'),_0x3c7766,_0x92b2('0xf'));logger[_0x92b2('0x10')](_0x92b2('0x11'),_0x3c7766,_0x92b2('0xf'),JSON['stringify'](_0x21b19d));if(_0x21b19d[_0x92b2('0x12')]){if(_0x21b19d[_0x92b2('0x12')][_0x92b2('0x13')]===0x1f4){logger[_0x92b2('0x12')](_0x92b2('0xe'),_0x3c7766,_0x21b19d[_0x92b2('0x12')][_0x92b2('0x14')]);return _0x3d8d33(_0x21b19d[_0x92b2('0x12')][_0x92b2('0x14')]);}logger['error'](_0x92b2('0xe'),_0x3c7766,_0x21b19d[_0x92b2('0x12')]['message']);return _0x14571e(_0x21b19d[_0x92b2('0x12')][_0x92b2('0x14')]);}else{logger[_0x92b2('0xd')](_0x92b2('0xe'),_0x3c7766,'request\x20sent');_0x14571e(_0x21b19d[_0x92b2('0x15')][_0x92b2('0x14')]);}})[_0x92b2('0x16')](function(_0x4e167b){logger[_0x92b2('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3c7766,_0x4e167b);_0x3d8d33(_0x4e167b);});});}