Built motion from commit b0a9a629.|2.6.33
[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 _0x5e9a=['catch','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1d3864,_0x11fd66){var _0x2a2f1b=function(_0x3d66fa){while(--_0x3d66fa){_0x1d3864['push'](_0x1d3864['shift']());}};_0x2a2f1b(++_0x11fd66);}(_0x5e9a,0x155));var _0xa5e9=function(_0x4517f3,_0x3af8ef){_0x4517f3=_0x4517f3-0x0;var _0x1d63d3=_0x5e9a[_0x4517f3];return _0x1d63d3;};'use strict';var _=require('lodash');var util=require(_0xa5e9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa5e9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa5e9('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5e9('0x3'))(_0xa5e9('0x4'));var config=require(_0xa5e9('0x5'));var jayson=require(_0xa5e9('0x6'));var client=jayson[_0xa5e9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f2cf4,_0x5e2dc9,_0x3e117a){return new BPromise(function(_0x277e39,_0x507aca){return client[_0xa5e9('0x8')](_0x1f2cf4,_0x3e117a)['then'](function(_0x11010c){logger[_0xa5e9('0x9')](_0xa5e9('0xa'),_0x5e2dc9,_0xa5e9('0xb'));logger[_0xa5e9('0xc')](_0xa5e9('0xd'),_0x5e2dc9,_0xa5e9('0xb'),JSON[_0xa5e9('0xe')](_0x11010c));if(_0x11010c[_0xa5e9('0xf')]){if(_0x11010c[_0xa5e9('0xf')][_0xa5e9('0x10')]===0x1f4){logger[_0xa5e9('0xf')](_0xa5e9('0xa'),_0x5e2dc9,_0x11010c['error'][_0xa5e9('0x11')]);return _0x507aca(_0x11010c[_0xa5e9('0xf')][_0xa5e9('0x11')]);}logger['error'](_0xa5e9('0xa'),_0x5e2dc9,_0x11010c[_0xa5e9('0xf')]['message']);return _0x277e39(_0x11010c['error'][_0xa5e9('0x11')]);}else{logger[_0xa5e9('0x9')]('SalesforceField,\x20%s,\x20%s',_0x5e2dc9,_0xa5e9('0xb'));_0x277e39(_0x11010c[_0xa5e9('0x12')][_0xa5e9('0x11')]);}})[_0xa5e9('0x13')](function(_0x49baed){logger[_0xa5e9('0xf')]('SalesforceField,\x20%s,\x20%s',_0x5e2dc9,_0x49baed);_0x507aca(_0x49baed);});});}