dd21b05bf550704103187dd4c50bcbf65bb4db3a
[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 _0x7168=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','jayson/promise','client'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x7168,0xc9));var _0x8716=function(_0x1563d8,_0x3b5455){_0x1563d8=_0x1563d8-0x0;var _0x52d130=_0x7168[_0x1563d8];return _0x52d130;};'use strict';var _=require(_0x8716('0x0'));var util=require(_0x8716('0x1'));var moment=require(_0x8716('0x2'));var BPromise=require(_0x8716('0x3'));var rs=require(_0x8716('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8716('0x5'))(_0x8716('0x6'));var config=require('../../config/environment');var jayson=require(_0x8716('0x7'));var client=jayson[_0x8716('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x468d66,_0x4ca9dc,_0x4d484b){return new BPromise(function(_0x35ad82,_0x48f307){return client[_0x8716('0x9')](_0x468d66,_0x4d484b)[_0x8716('0xa')](function(_0x1de581){logger[_0x8716('0xb')](_0x8716('0xc'),_0x4ca9dc,_0x8716('0xd'));logger[_0x8716('0xe')](_0x8716('0xf'),_0x4ca9dc,_0x8716('0xd'),JSON['stringify'](_0x1de581));if(_0x1de581[_0x8716('0x10')]){if(_0x1de581[_0x8716('0x10')][_0x8716('0x11')]===0x1f4){logger[_0x8716('0x10')](_0x8716('0xc'),_0x4ca9dc,_0x1de581[_0x8716('0x10')]['message']);return _0x48f307(_0x1de581[_0x8716('0x10')][_0x8716('0x12')]);}logger[_0x8716('0x10')](_0x8716('0xc'),_0x4ca9dc,_0x1de581[_0x8716('0x10')][_0x8716('0x12')]);return _0x35ad82(_0x1de581[_0x8716('0x10')][_0x8716('0x12')]);}else{logger[_0x8716('0xb')](_0x8716('0xc'),_0x4ca9dc,_0x8716('0xd'));_0x35ad82(_0x1de581[_0x8716('0x13')]['message']);}})[_0x8716('0x14')](function(_0x22bc50){logger[_0x8716('0x10')](_0x8716('0xc'),_0x4ca9dc,_0x22bc50);_0x48f307(_0x22bc50);});});}