Built motion from commit (unavailable).|2.5.22
[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 _0xb8b3=['jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0xb8b3,0xfd));var _0x3b8b=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xb8b3[_0x310a1b];return _0xdea206;};'use strict';var _=require('lodash');var util=require(_0x3b8b('0x0'));var moment=require(_0x3b8b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b8b('0x2'))['db'];var utils=require(_0x3b8b('0x3'));var logger=require(_0x3b8b('0x4'))(_0x3b8b('0x5'));var config=require(_0x3b8b('0x6'));var jayson=require(_0x3b8b('0x7'));var client=jayson['client'][_0x3b8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38b7b6,_0x270a86,_0x4b5326){return new BPromise(function(_0xd0453d,_0x597cc0){return client[_0x3b8b('0x9')](_0x38b7b6,_0x4b5326)[_0x3b8b('0xa')](function(_0x2ec045){logger[_0x3b8b('0xb')](_0x3b8b('0xc'),_0x270a86,_0x3b8b('0xd'));logger[_0x3b8b('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x270a86,'request\x20sent',JSON[_0x3b8b('0xf')](_0x2ec045));if(_0x2ec045[_0x3b8b('0x10')]){if(_0x2ec045[_0x3b8b('0x10')][_0x3b8b('0x11')]===0x1f4){logger[_0x3b8b('0x10')](_0x3b8b('0xc'),_0x270a86,_0x2ec045[_0x3b8b('0x10')]['message']);return _0x597cc0(_0x2ec045['error'][_0x3b8b('0x12')]);}logger[_0x3b8b('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x270a86,_0x2ec045[_0x3b8b('0x10')][_0x3b8b('0x12')]);return _0xd0453d(_0x2ec045[_0x3b8b('0x10')][_0x3b8b('0x12')]);}else{logger['info'](_0x3b8b('0xc'),_0x270a86,_0x3b8b('0xd'));_0xd0453d(_0x2ec045[_0x3b8b('0x13')][_0x3b8b('0x12')]);}})['catch'](function(_0x5c1f4e){logger[_0x3b8b('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x270a86,_0x5c1f4e);_0x597cc0(_0x5c1f4e);});});}