Built motion from commit c1aa34a0.|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 _0x3431=['jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x259aee,_0x51a415){var _0x191c48=function(_0x3e65b6){while(--_0x3e65b6){_0x259aee['push'](_0x259aee['shift']());}};_0x191c48(++_0x51a415);}(_0x3431,0xc6));var _0x1343=function(_0x4a96ca,_0x13754e){_0x4a96ca=_0x4a96ca-0x0;var _0x2aed48=_0x3431[_0x4a96ca];return _0x2aed48;};'use strict';var _=require(_0x1343('0x0'));var util=require('util');var moment=require(_0x1343('0x1'));var BPromise=require(_0x1343('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1343('0x3'));var db=require(_0x1343('0x4'))['db'];var utils=require(_0x1343('0x5'));var logger=require(_0x1343('0x6'))(_0x1343('0x7'));var config=require(_0x1343('0x8'));var jayson=require(_0x1343('0x9'));var client=jayson[_0x1343('0xa')][_0x1343('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a8b3c,_0x5cd609,_0x3546b6){return new BPromise(function(_0x2423a4,_0x3fbe82){return client['request'](_0x3a8b3c,_0x3546b6)[_0x1343('0xc')](function(_0x25af0b){logger[_0x1343('0xd')](_0x1343('0xe'),_0x5cd609,_0x1343('0xf'));logger['debug'](_0x1343('0x10'),_0x5cd609,'request\x20sent',JSON[_0x1343('0x11')](_0x25af0b));if(_0x25af0b[_0x1343('0x12')]){if(_0x25af0b[_0x1343('0x12')][_0x1343('0x13')]===0x1f4){logger[_0x1343('0x12')](_0x1343('0xe'),_0x5cd609,_0x25af0b[_0x1343('0x12')][_0x1343('0x14')]);return _0x3fbe82(_0x25af0b[_0x1343('0x12')][_0x1343('0x14')]);}logger[_0x1343('0x12')](_0x1343('0xe'),_0x5cd609,_0x25af0b[_0x1343('0x12')]['message']);return _0x2423a4(_0x25af0b[_0x1343('0x12')][_0x1343('0x14')]);}else{logger[_0x1343('0xd')](_0x1343('0xe'),_0x5cd609,_0x1343('0xf'));_0x2423a4(_0x25af0b[_0x1343('0x15')]['message']);}})[_0x1343('0x16')](function(_0x53d67e){logger[_0x1343('0x12')](_0x1343('0xe'),_0x5cd609,_0x53d67e);_0x3fbe82(_0x53d67e);});});}