52e6a8211ab13f0ab4c3c8af7d0f223c668fc375
[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 _0x957e=['util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash'];(function(_0x1ca22e,_0x367312){var _0x60b390=function(_0x3a90d3){while(--_0x3a90d3){_0x1ca22e['push'](_0x1ca22e['shift']());}};_0x60b390(++_0x367312);}(_0x957e,0xfb));var _0xe957=function(_0xec9322,_0x2d5b87){_0xec9322=_0xec9322-0x0;var _0x39d576=_0x957e[_0xec9322];return _0x39d576;};'use strict';var _=require(_0xe957('0x0'));var util=require(_0xe957('0x1'));var moment=require(_0xe957('0x2'));var BPromise=require('bluebird');var rs=require(_0xe957('0x3'));var fs=require('fs');var Redis=require(_0xe957('0x4'));var db=require(_0xe957('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe957('0x6'));var config=require('../../config/environment');var jayson=require(_0xe957('0x7'));var client=jayson[_0xe957('0x8')][_0xe957('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23f27f,_0x24ddde,_0x47a37c){return new BPromise(function(_0x5f3825,_0x59cc2a){return client[_0xe957('0xa')](_0x23f27f,_0x47a37c)[_0xe957('0xb')](function(_0x486733){logger[_0xe957('0xc')](_0xe957('0xd'),_0x24ddde,'request\x20sent');logger[_0xe957('0xe')](_0xe957('0xf'),_0x24ddde,_0xe957('0x10'),JSON[_0xe957('0x11')](_0x486733));if(_0x486733[_0xe957('0x12')]){if(_0x486733[_0xe957('0x12')]['code']===0x1f4){logger[_0xe957('0x12')](_0xe957('0xd'),_0x24ddde,_0x486733[_0xe957('0x12')][_0xe957('0x13')]);return _0x59cc2a(_0x486733[_0xe957('0x12')][_0xe957('0x13')]);}logger[_0xe957('0x12')](_0xe957('0xd'),_0x24ddde,_0x486733['error'][_0xe957('0x13')]);return _0x5f3825(_0x486733[_0xe957('0x12')][_0xe957('0x13')]);}else{logger[_0xe957('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x24ddde,_0xe957('0x10'));_0x5f3825(_0x486733['result'][_0xe957('0x13')]);}})[_0xe957('0x14')](function(_0x143088){logger[_0xe957('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x24ddde,_0x143088);_0x59cc2a(_0x143088);});});}