89e97430fc496060d0b50f06c4d44737b5da1a09
[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 _0x8b88=['request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0x26ce83,_0x15eee3){var _0x17c81c=function(_0x5e00fa){while(--_0x5e00fa){_0x26ce83['push'](_0x26ce83['shift']());}};_0x17c81c(++_0x15eee3);}(_0x8b88,0x1d1));var _0x88b8=function(_0x5285aa,_0x1bf371){_0x5285aa=_0x5285aa-0x0;var _0x26a4d6=_0x8b88[_0x5285aa];return _0x26a4d6;};'use strict';var _=require(_0x88b8('0x0'));var util=require(_0x88b8('0x1'));var moment=require(_0x88b8('0x2'));var BPromise=require(_0x88b8('0x3'));var rs=require(_0x88b8('0x4'));var fs=require('fs');var Redis=require(_0x88b8('0x5'));var db=require(_0x88b8('0x6'))['db'];var utils=require(_0x88b8('0x7'));var logger=require('../../config/logger')(_0x88b8('0x8'));var config=require('../../config/environment');var jayson=require(_0x88b8('0x9'));var client=jayson[_0x88b8('0xa')][_0x88b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33f708,_0x3880e7,_0x35597a){return new BPromise(function(_0x1552e5,_0x40801b){return client[_0x88b8('0xc')](_0x33f708,_0x35597a)[_0x88b8('0xd')](function(_0x518711){logger['info'](_0x88b8('0xe'),_0x3880e7,_0x88b8('0xf'));logger[_0x88b8('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3880e7,_0x88b8('0xf'),JSON[_0x88b8('0x11')](_0x518711));if(_0x518711[_0x88b8('0x12')]){if(_0x518711[_0x88b8('0x12')][_0x88b8('0x13')]===0x1f4){logger[_0x88b8('0x12')](_0x88b8('0xe'),_0x3880e7,_0x518711[_0x88b8('0x12')][_0x88b8('0x14')]);return _0x40801b(_0x518711[_0x88b8('0x12')][_0x88b8('0x14')]);}logger[_0x88b8('0x12')](_0x88b8('0xe'),_0x3880e7,_0x518711[_0x88b8('0x12')][_0x88b8('0x14')]);return _0x1552e5(_0x518711[_0x88b8('0x12')][_0x88b8('0x14')]);}else{logger[_0x88b8('0x15')](_0x88b8('0xe'),_0x3880e7,'request\x20sent');_0x1552e5(_0x518711[_0x88b8('0x16')]['message']);}})[_0x88b8('0x17')](function(_0x252b03){logger[_0x88b8('0x12')](_0x88b8('0xe'),_0x3880e7,_0x252b03);_0x40801b(_0x252b03);});});}