f2828556701ccb2c2584f76b323d45bdd3704b9d
[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 _0x8aaf=['rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2ddd42,_0x39be46){var _0x189dc1=function(_0xab9aac){while(--_0xab9aac){_0x2ddd42['push'](_0x2ddd42['shift']());}};_0x189dc1(++_0x39be46);}(_0x8aaf,0x1d2));var _0xf8aa=function(_0x363ae2,_0xd9988b){_0x363ae2=_0x363ae2-0x0;var _0x2c6c4e=_0x8aaf[_0x363ae2];return _0x2c6c4e;};'use strict';var _=require(_0xf8aa('0x0'));var util=require(_0xf8aa('0x1'));var moment=require(_0xf8aa('0x2'));var BPromise=require(_0xf8aa('0x3'));var rs=require(_0xf8aa('0x4'));var fs=require('fs');var Redis=require(_0xf8aa('0x5'));var db=require(_0xf8aa('0x6'))['db'];var utils=require(_0xf8aa('0x7'));var logger=require(_0xf8aa('0x8'))(_0xf8aa('0x9'));var config=require(_0xf8aa('0xa'));var jayson=require(_0xf8aa('0xb'));var client=jayson[_0xf8aa('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x499614,_0x3eb2ee,_0x26b542){return new BPromise(function(_0x13014f,_0x466782){return client[_0xf8aa('0xd')](_0x499614,_0x26b542)[_0xf8aa('0xe')](function(_0x4761a7){logger[_0xf8aa('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3eb2ee,_0xf8aa('0x10'));logger[_0xf8aa('0x11')](_0xf8aa('0x12'),_0x3eb2ee,_0xf8aa('0x10'),JSON[_0xf8aa('0x13')](_0x4761a7));if(_0x4761a7[_0xf8aa('0x14')]){if(_0x4761a7[_0xf8aa('0x14')]['code']===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x3eb2ee,_0x4761a7[_0xf8aa('0x14')][_0xf8aa('0x15')]);return _0x466782(_0x4761a7[_0xf8aa('0x14')]['message']);}logger['error'](_0xf8aa('0x16'),_0x3eb2ee,_0x4761a7[_0xf8aa('0x14')][_0xf8aa('0x15')]);return _0x13014f(_0x4761a7[_0xf8aa('0x14')][_0xf8aa('0x15')]);}else{logger[_0xf8aa('0xf')](_0xf8aa('0x16'),_0x3eb2ee,_0xf8aa('0x10'));_0x13014f(_0x4761a7[_0xf8aa('0x17')][_0xf8aa('0x15')]);}})[_0xf8aa('0x18')](function(_0x46753f){logger[_0xf8aa('0x14')](_0xf8aa('0x16'),_0x3eb2ee,_0x46753f);_0x466782(_0x46753f);});});}