Built motion from commit (unavailable).|2.5.20
[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 _0xc25f=['http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2ab751,_0x3d1c7c){var _0x2afecb=function(_0xe07e35){while(--_0xe07e35){_0x2ab751['push'](_0x2ab751['shift']());}};_0x2afecb(++_0x3d1c7c);}(_0xc25f,0x160));var _0xfc25=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc25f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xfc25('0x0'));var moment=require('moment');var BPromise=require(_0xfc25('0x1'));var rs=require(_0xfc25('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc25('0x3'))['db'];var utils=require(_0xfc25('0x4'));var logger=require(_0xfc25('0x5'))(_0xfc25('0x6'));var config=require(_0xfc25('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfc25('0x8')][_0xfc25('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x588781,_0x2096b1,_0x26ea18){return new BPromise(function(_0x537832,_0x4280be){return client[_0xfc25('0xa')](_0x588781,_0x26ea18)['then'](function(_0x2ce8da){logger[_0xfc25('0xb')](_0xfc25('0xc'),_0x2096b1,_0xfc25('0xd'));logger[_0xfc25('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2096b1,'request\x20sent',JSON[_0xfc25('0xf')](_0x2ce8da));if(_0x2ce8da[_0xfc25('0x10')]){if(_0x2ce8da[_0xfc25('0x10')]['code']===0x1f4){logger['error'](_0xfc25('0xc'),_0x2096b1,_0x2ce8da[_0xfc25('0x10')]['message']);return _0x4280be(_0x2ce8da['error'][_0xfc25('0x11')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x2096b1,_0x2ce8da[_0xfc25('0x10')][_0xfc25('0x11')]);return _0x537832(_0x2ce8da[_0xfc25('0x10')][_0xfc25('0x11')]);}else{logger['info'](_0xfc25('0xc'),_0x2096b1,_0xfc25('0xd'));_0x537832(_0x2ce8da[_0xfc25('0x12')][_0xfc25('0x11')]);}})['catch'](function(_0x550236){logger['error'](_0xfc25('0xc'),_0x2096b1,_0x550236);_0x4280be(_0x550236);});});}