Built motion from commit (unavailable).|2.4.17
[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 _0x1207=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util'];(function(_0x49863a,_0x590eb6){var _0x1ee8bf=function(_0x404419){while(--_0x404419){_0x49863a['push'](_0x49863a['shift']());}};_0x1ee8bf(++_0x590eb6);}(_0x1207,0x185));var _0x7120=function(_0x157e1b,_0x4c4740){_0x157e1b=_0x157e1b-0x0;var _0x5ad47e=_0x1207[_0x157e1b];return _0x5ad47e;};'use strict';var _=require(_0x7120('0x0'));var util=require(_0x7120('0x1'));var moment=require(_0x7120('0x2'));var BPromise=require(_0x7120('0x3'));var rs=require(_0x7120('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7120('0x5'))['db'];var utils=require(_0x7120('0x6'));var logger=require(_0x7120('0x7'))(_0x7120('0x8'));var config=require(_0x7120('0x9'));var jayson=require(_0x7120('0xa'));var client=jayson[_0x7120('0xb')][_0x7120('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb37460,_0x111c92,_0x4af071){return new BPromise(function(_0x21a4be,_0x31dd86){return client[_0x7120('0xd')](_0xb37460,_0x4af071)['then'](function(_0x53c887){logger[_0x7120('0xe')](_0x7120('0xf'),_0x111c92,'request\x20sent');logger[_0x7120('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x111c92,'request\x20sent',JSON[_0x7120('0x11')](_0x53c887));if(_0x53c887[_0x7120('0x12')]){if(_0x53c887[_0x7120('0x12')][_0x7120('0x13')]===0x1f4){logger[_0x7120('0x12')](_0x7120('0xf'),_0x111c92,_0x53c887['error'][_0x7120('0x14')]);return _0x31dd86(_0x53c887[_0x7120('0x12')]['message']);}logger[_0x7120('0x12')](_0x7120('0xf'),_0x111c92,_0x53c887[_0x7120('0x12')][_0x7120('0x14')]);return _0x21a4be(_0x53c887[_0x7120('0x12')]['message']);}else{logger['info'](_0x7120('0xf'),_0x111c92,_0x7120('0x15'));_0x21a4be(_0x53c887[_0x7120('0x16')][_0x7120('0x14')]);}})['catch'](function(_0x1f4c80){logger[_0x7120('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x111c92,_0x1f4c80);_0x31dd86(_0x1f4c80);});});}