c63f774ee27d3d9be7c2ae4c160d5bbdce804779
[motion2.git] / server / api / intSalesforceField / intSalesforceField.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 _0x4131=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5cdf8a,_0x2bd24d){var _0x5548d7=function(_0x47b15a){while(--_0x47b15a){_0x5cdf8a['push'](_0x5cdf8a['shift']());}};_0x5548d7(++_0x2bd24d);}(_0x4131,0x153));var _0x1413=function(_0x35f969,_0x2c03bd){_0x35f969=_0x35f969-0x0;var _0x373c46=_0x4131[_0x35f969];return _0x373c46;};'use strict';var _=require(_0x1413('0x0'));var util=require(_0x1413('0x1'));var moment=require(_0x1413('0x2'));var BPromise=require(_0x1413('0x3'));var rs=require(_0x1413('0x4'));var fs=require('fs');var Redis=require(_0x1413('0x5'));var db=require(_0x1413('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1413('0x7'))(_0x1413('0x8'));var config=require(_0x1413('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1413('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x188269,_0x462935,_0x1602b8){return new BPromise(function(_0x51a7e8,_0x426250){return client[_0x1413('0xb')](_0x188269,_0x1602b8)[_0x1413('0xc')](function(_0x4ad642){logger[_0x1413('0xd')](_0x1413('0xe'),_0x462935,_0x1413('0xf'));logger['debug'](_0x1413('0x10'),_0x462935,_0x1413('0xf'),JSON[_0x1413('0x11')](_0x4ad642));if(_0x4ad642[_0x1413('0x12')]){if(_0x4ad642['error'][_0x1413('0x13')]===0x1f4){logger[_0x1413('0x12')](_0x1413('0xe'),_0x462935,_0x4ad642['error']['message']);return _0x426250(_0x4ad642[_0x1413('0x12')][_0x1413('0x14')]);}logger['error'](_0x1413('0xe'),_0x462935,_0x4ad642[_0x1413('0x12')][_0x1413('0x14')]);return _0x51a7e8(_0x4ad642['error'][_0x1413('0x14')]);}else{logger['info'](_0x1413('0xe'),_0x462935,_0x1413('0xf'));_0x51a7e8(_0x4ad642[_0x1413('0x15')]['message']);}})[_0x1413('0x16')](function(_0x20af86){logger['error'](_0x1413('0xe'),_0x462935,_0x20af86);_0x426250(_0x20af86);});});}