Built motion from commit f7863d46.|2.5.41
[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 _0x1be7=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0x39560c,_0x373f32){var _0x48db9d=function(_0x80f962){while(--_0x80f962){_0x39560c['push'](_0x39560c['shift']());}};_0x48db9d(++_0x373f32);}(_0x1be7,0x7b));var _0x71be=function(_0x168765,_0x534f44){_0x168765=_0x168765-0x0;var _0x3ee3a0=_0x1be7[_0x168765];return _0x3ee3a0;};'use strict';var _=require(_0x71be('0x0'));var util=require(_0x71be('0x1'));var moment=require(_0x71be('0x2'));var BPromise=require(_0x71be('0x3'));var rs=require(_0x71be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71be('0x5'))['db'];var utils=require(_0x71be('0x6'));var logger=require(_0x71be('0x7'))(_0x71be('0x8'));var config=require(_0x71be('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x71be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47f7d1,_0x35c3c7,_0x21bcb7){return new BPromise(function(_0x2a0952,_0x2de1b6){return client['request'](_0x47f7d1,_0x21bcb7)['then'](function(_0x15dcd7){logger[_0x71be('0xb')](_0x71be('0xc'),_0x35c3c7,'request\x20sent');logger[_0x71be('0xd')](_0x71be('0xe'),_0x35c3c7,'request\x20sent',JSON['stringify'](_0x15dcd7));if(_0x15dcd7[_0x71be('0xf')]){if(_0x15dcd7['error'][_0x71be('0x10')]===0x1f4){logger[_0x71be('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x35c3c7,_0x15dcd7[_0x71be('0xf')]['message']);return _0x2de1b6(_0x15dcd7['error'][_0x71be('0x11')]);}logger[_0x71be('0xf')](_0x71be('0xc'),_0x35c3c7,_0x15dcd7[_0x71be('0xf')][_0x71be('0x11')]);return _0x2a0952(_0x15dcd7[_0x71be('0xf')][_0x71be('0x11')]);}else{logger[_0x71be('0xb')](_0x71be('0xc'),_0x35c3c7,_0x71be('0x12'));_0x2a0952(_0x15dcd7[_0x71be('0x13')][_0x71be('0x11')]);}})[_0x71be('0x14')](function(_0x11005e){logger[_0x71be('0xf')](_0x71be('0xc'),_0x35c3c7,_0x11005e);_0x2de1b6(_0x11005e);});});}