Built motion from commit (unavailable).|2.3.4
[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 _0xc3fa=['http','request','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xc3fa,0x84));var _0xac3f=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0xc3fa[_0x5aef17];return _0x43f9d0;};'use strict';var _=require(_0xac3f('0x0'));var util=require(_0xac3f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac3f('0x2'));var db=require(_0xac3f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac3f('0x4'));var config=require(_0xac3f('0x5'));var jayson=require(_0xac3f('0x6'));var client=jayson[_0xac3f('0x7')][_0xac3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b253a,_0x3aa122,_0xc06517){return new BPromise(function(_0x5e7fa3,_0x51a801){return client[_0xac3f('0x9')](_0x5b253a,_0xc06517)['then'](function(_0x1fc879){logger[_0xac3f('0xa')](_0xac3f('0xb'),_0x3aa122,'request\x20sent');logger['debug'](_0xac3f('0xc'),_0x3aa122,'request\x20sent',JSON[_0xac3f('0xd')](_0x1fc879));if(_0x1fc879[_0xac3f('0xe')]){if(_0x1fc879[_0xac3f('0xe')][_0xac3f('0xf')]===0x1f4){logger[_0xac3f('0xe')](_0xac3f('0xb'),_0x3aa122,_0x1fc879[_0xac3f('0xe')][_0xac3f('0x10')]);return _0x51a801(_0x1fc879[_0xac3f('0xe')]['message']);}logger['error'](_0xac3f('0xb'),_0x3aa122,_0x1fc879['error'][_0xac3f('0x10')]);return _0x5e7fa3(_0x1fc879[_0xac3f('0xe')]['message']);}else{logger[_0xac3f('0xa')]('SalesforceField,\x20%s,\x20%s',_0x3aa122,_0xac3f('0x11'));_0x5e7fa3(_0x1fc879[_0xac3f('0x12')][_0xac3f('0x10')]);}})[_0xac3f('0x13')](function(_0x28cf74){logger[_0xac3f('0xe')](_0xac3f('0xb'),_0x3aa122,_0x28cf74);_0x51a801(_0x28cf74);});});}