Built motion from commit b5413ace.|2.6.9
[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 _0xec38=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x50b25c,_0x50e986){var _0x4a574c=function(_0x439d34){while(--_0x439d34){_0x50b25c['push'](_0x50b25c['shift']());}};_0x4a574c(++_0x50e986);}(_0xec38,0x68));var _0x8ec3=function(_0x1f3fe8,_0x91d84a){_0x1f3fe8=_0x1f3fe8-0x0;var _0x5c6369=_0xec38[_0x1f3fe8];return _0x5c6369;};'use strict';var _=require(_0x8ec3('0x0'));var util=require('util');var moment=require(_0x8ec3('0x1'));var BPromise=require(_0x8ec3('0x2'));var rs=require(_0x8ec3('0x3'));var fs=require('fs');var Redis=require(_0x8ec3('0x4'));var db=require(_0x8ec3('0x5'))['db'];var utils=require(_0x8ec3('0x6'));var logger=require(_0x8ec3('0x7'))(_0x8ec3('0x8'));var config=require(_0x8ec3('0x9'));var jayson=require(_0x8ec3('0xa'));var client=jayson[_0x8ec3('0xb')][_0x8ec3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b9349,_0x31d696,_0x41c3fe){return new BPromise(function(_0x4f0c04,_0x1042b7){return client[_0x8ec3('0xd')](_0x3b9349,_0x41c3fe)[_0x8ec3('0xe')](function(_0x1ff972){logger['info'](_0x8ec3('0xf'),_0x31d696,_0x8ec3('0x10'));logger[_0x8ec3('0x11')](_0x8ec3('0x12'),_0x31d696,'request\x20sent',JSON[_0x8ec3('0x13')](_0x1ff972));if(_0x1ff972[_0x8ec3('0x14')]){if(_0x1ff972[_0x8ec3('0x14')][_0x8ec3('0x15')]===0x1f4){logger[_0x8ec3('0x14')]('SalesforceField,\x20%s,\x20%s',_0x31d696,_0x1ff972[_0x8ec3('0x14')][_0x8ec3('0x16')]);return _0x1042b7(_0x1ff972[_0x8ec3('0x14')][_0x8ec3('0x16')]);}logger[_0x8ec3('0x14')](_0x8ec3('0xf'),_0x31d696,_0x1ff972['error'][_0x8ec3('0x16')]);return _0x4f0c04(_0x1ff972[_0x8ec3('0x14')][_0x8ec3('0x16')]);}else{logger[_0x8ec3('0x17')]('SalesforceField,\x20%s,\x20%s',_0x31d696,_0x8ec3('0x10'));_0x4f0c04(_0x1ff972[_0x8ec3('0x18')][_0x8ec3('0x16')]);}})[_0x8ec3('0x19')](function(_0x15de8d){logger[_0x8ec3('0x14')](_0x8ec3('0xf'),_0x31d696,_0x15de8d);_0x1042b7(_0x15de8d);});});}