Built motion from commit d1eab355.|2.6.28
[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 _0xf735=['debug','stringify','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x55505c,_0x2f8ab7){var _0x1f9144=function(_0x3e55e1){while(--_0x3e55e1){_0x55505c['push'](_0x55505c['shift']());}};_0x1f9144(++_0x2f8ab7);}(_0xf735,0x84));var _0x5f73=function(_0x31cc78,_0x5e1e0f){_0x31cc78=_0x31cc78-0x0;var _0x171dc7=_0xf735[_0x31cc78];return _0x171dc7;};'use strict';var _=require(_0x5f73('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5f73('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f73('0x2'));var db=require(_0x5f73('0x3'))['db'];var utils=require(_0x5f73('0x4'));var logger=require(_0x5f73('0x5'))(_0x5f73('0x6'));var config=require(_0x5f73('0x7'));var jayson=require(_0x5f73('0x8'));var client=jayson['client'][_0x5f73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdf3851,_0xd822ac,_0x16981b){return new BPromise(function(_0x441e6d,_0x2986b6){return client[_0x5f73('0xa')](_0xdf3851,_0x16981b)[_0x5f73('0xb')](function(_0x1cc891){logger[_0x5f73('0xc')](_0x5f73('0xd'),_0xd822ac,_0x5f73('0xe'));logger[_0x5f73('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xd822ac,'request\x20sent',JSON[_0x5f73('0x10')](_0x1cc891));if(_0x1cc891[_0x5f73('0x11')]){if(_0x1cc891['error']['code']===0x1f4){logger[_0x5f73('0x11')](_0x5f73('0xd'),_0xd822ac,_0x1cc891[_0x5f73('0x11')][_0x5f73('0x12')]);return _0x2986b6(_0x1cc891[_0x5f73('0x11')][_0x5f73('0x12')]);}logger[_0x5f73('0x11')](_0x5f73('0xd'),_0xd822ac,_0x1cc891[_0x5f73('0x11')][_0x5f73('0x12')]);return _0x441e6d(_0x1cc891['error'][_0x5f73('0x12')]);}else{logger[_0x5f73('0xc')](_0x5f73('0xd'),_0xd822ac,_0x5f73('0xe'));_0x441e6d(_0x1cc891[_0x5f73('0x13')][_0x5f73('0x12')]);}})[_0x5f73('0x14')](function(_0x14ac0c){logger['error'](_0x5f73('0xd'),_0xd822ac,_0x14ac0c);_0x2986b6(_0x14ac0c);});});}