Built motion from commit e02f907f.|2.6.14
[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 _0x5045=['message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x22ae56,_0x16955c){var _0x1544f5=function(_0x2d525f){while(--_0x2d525f){_0x22ae56['push'](_0x22ae56['shift']());}};_0x1544f5(++_0x16955c);}(_0x5045,0x75));var _0x5504=function(_0x3b2f14,_0x363cb6){_0x3b2f14=_0x3b2f14-0x0;var _0x5e0846=_0x5045[_0x3b2f14];return _0x5e0846;};'use strict';var _=require('lodash');var util=require(_0x5504('0x0'));var moment=require(_0x5504('0x1'));var BPromise=require(_0x5504('0x2'));var rs=require(_0x5504('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5504('0x4'))['db'];var utils=require(_0x5504('0x5'));var logger=require(_0x5504('0x6'))('rpc');var config=require(_0x5504('0x7'));var jayson=require(_0x5504('0x8'));var client=jayson[_0x5504('0x9')][_0x5504('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x441602,_0x3d7e1d,_0x310388){return new BPromise(function(_0x34a3f1,_0xdf4eaa){return client[_0x5504('0xb')](_0x441602,_0x310388)[_0x5504('0xc')](function(_0x4b9451){logger[_0x5504('0xd')](_0x5504('0xe'),_0x3d7e1d,_0x5504('0xf'));logger[_0x5504('0x10')](_0x5504('0x11'),_0x3d7e1d,_0x5504('0xf'),JSON[_0x5504('0x12')](_0x4b9451));if(_0x4b9451['error']){if(_0x4b9451[_0x5504('0x13')][_0x5504('0x14')]===0x1f4){logger['error'](_0x5504('0xe'),_0x3d7e1d,_0x4b9451[_0x5504('0x13')][_0x5504('0x15')]);return _0xdf4eaa(_0x4b9451[_0x5504('0x13')][_0x5504('0x15')]);}logger[_0x5504('0x13')](_0x5504('0xe'),_0x3d7e1d,_0x4b9451[_0x5504('0x13')][_0x5504('0x15')]);return _0x34a3f1(_0x4b9451[_0x5504('0x13')][_0x5504('0x15')]);}else{logger[_0x5504('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d7e1d,_0x5504('0xf'));_0x34a3f1(_0x4b9451['result'][_0x5504('0x15')]);}})[_0x5504('0x16')](function(_0x7560d3){logger[_0x5504('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d7e1d,_0x7560d3);_0xdf4eaa(_0x7560d3);});});}