9e6d13ab0d66b0469ed9253307523c288d68aedb
[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 _0xfc63=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0xfc63,0x1a3));var _0x3fc6=function(_0x7a9bf7,_0x47ea66){_0x7a9bf7=_0x7a9bf7-0x0;var _0x4ac0e3=_0xfc63[_0x7a9bf7];return _0x4ac0e3;};'use strict';var _=require(_0x3fc6('0x0'));var util=require(_0x3fc6('0x1'));var moment=require(_0x3fc6('0x2'));var BPromise=require(_0x3fc6('0x3'));var rs=require(_0x3fc6('0x4'));var fs=require('fs');var Redis=require(_0x3fc6('0x5'));var db=require(_0x3fc6('0x6'))['db'];var utils=require(_0x3fc6('0x7'));var logger=require(_0x3fc6('0x8'))(_0x3fc6('0x9'));var config=require(_0x3fc6('0xa'));var jayson=require(_0x3fc6('0xb'));var client=jayson[_0x3fc6('0xc')][_0x3fc6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3c10c9,_0x4ae967,_0x5d8bde){return new BPromise(function(_0x18a0d2,_0x1b46e9){return client[_0x3fc6('0xe')](_0x3c10c9,_0x5d8bde)[_0x3fc6('0xf')](function(_0x29cb94){logger[_0x3fc6('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4ae967,_0x3fc6('0x11'));logger[_0x3fc6('0x12')](_0x3fc6('0x13'),_0x4ae967,_0x3fc6('0x11'),JSON[_0x3fc6('0x14')](_0x29cb94));if(_0x29cb94[_0x3fc6('0x15')]){if(_0x29cb94[_0x3fc6('0x15')][_0x3fc6('0x16')]===0x1f4){logger['error'](_0x3fc6('0x17'),_0x4ae967,_0x29cb94[_0x3fc6('0x15')][_0x3fc6('0x18')]);return _0x1b46e9(_0x29cb94[_0x3fc6('0x15')][_0x3fc6('0x18')]);}logger[_0x3fc6('0x15')](_0x3fc6('0x17'),_0x4ae967,_0x29cb94[_0x3fc6('0x15')][_0x3fc6('0x18')]);return _0x18a0d2(_0x29cb94[_0x3fc6('0x15')][_0x3fc6('0x18')]);}else{logger[_0x3fc6('0x10')](_0x3fc6('0x17'),_0x4ae967,'request\x20sent');_0x18a0d2(_0x29cb94['result']['message']);}})['catch'](function(_0x4a1417){logger['error'](_0x3fc6('0x17'),_0x4ae967,_0x4a1417);_0x1b46e9(_0x4a1417);});});}