Built motion from commit ffdca78c.|2.6.24
[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 _0x176a=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug'];(function(_0x3d3734,_0x1e557f){var _0x2e10d1=function(_0x504df0){while(--_0x504df0){_0x3d3734['push'](_0x3d3734['shift']());}};_0x2e10d1(++_0x1e557f);}(_0x176a,0xe5));var _0xa176=function(_0x1c625d,_0x105546){_0x1c625d=_0x1c625d-0x0;var _0x260791=_0x176a[_0x1c625d];return _0x260791;};'use strict';var _=require('lodash');var util=require(_0xa176('0x0'));var moment=require(_0xa176('0x1'));var BPromise=require('bluebird');var rs=require(_0xa176('0x2'));var fs=require('fs');var Redis=require(_0xa176('0x3'));var db=require(_0xa176('0x4'))['db'];var utils=require(_0xa176('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa176('0x6'));var jayson=require(_0xa176('0x7'));var client=jayson[_0xa176('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x186ff9,_0x3b6427,_0x5a3454){return new BPromise(function(_0x23a91a,_0x2ab762){return client[_0xa176('0x9')](_0x186ff9,_0x5a3454)[_0xa176('0xa')](function(_0x4dcd88){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x3b6427,_0xa176('0xb'));logger[_0xa176('0xc')](_0xa176('0xd'),_0x3b6427,'request\x20sent',JSON[_0xa176('0xe')](_0x4dcd88));if(_0x4dcd88[_0xa176('0xf')]){if(_0x4dcd88[_0xa176('0xf')][_0xa176('0x10')]===0x1f4){logger[_0xa176('0xf')](_0xa176('0x11'),_0x3b6427,_0x4dcd88[_0xa176('0xf')]['message']);return _0x2ab762(_0x4dcd88[_0xa176('0xf')][_0xa176('0x12')]);}logger[_0xa176('0xf')](_0xa176('0x11'),_0x3b6427,_0x4dcd88[_0xa176('0xf')][_0xa176('0x12')]);return _0x23a91a(_0x4dcd88[_0xa176('0xf')]['message']);}else{logger[_0xa176('0x13')](_0xa176('0x11'),_0x3b6427,'request\x20sent');_0x23a91a(_0x4dcd88[_0xa176('0x14')][_0xa176('0x12')]);}})[_0xa176('0x15')](function(_0x425ecf){logger[_0xa176('0xf')](_0xa176('0x11'),_0x3b6427,_0x425ecf);_0x2ab762(_0x425ecf);});});}