e6fa54e541b215c877cc9ab378867e2fe029b656
[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 _0xc53b=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x6ea8c2,_0x1aaa8e){var _0x4d07ff=function(_0x49e151){while(--_0x49e151){_0x6ea8c2['push'](_0x6ea8c2['shift']());}};_0x4d07ff(++_0x1aaa8e);}(_0xc53b,0x10b));var _0xbc53=function(_0x43281b,_0x1ec159){_0x43281b=_0x43281b-0x0;var _0xca6f2a=_0xc53b[_0x43281b];return _0xca6f2a;};'use strict';var _=require(_0xbc53('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbc53('0x1'));var rs=require(_0xbc53('0x2'));var fs=require('fs');var Redis=require(_0xbc53('0x3'));var db=require(_0xbc53('0x4'))['db'];var utils=require(_0xbc53('0x5'));var logger=require('../../config/logger')(_0xbc53('0x6'));var config=require(_0xbc53('0x7'));var jayson=require(_0xbc53('0x8'));var client=jayson['client'][_0xbc53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd9aaf0,_0x18464b,_0xfb3144){return new BPromise(function(_0x59a9b4,_0x85c8d2){return client[_0xbc53('0xa')](_0xd9aaf0,_0xfb3144)[_0xbc53('0xb')](function(_0x401e4a){logger[_0xbc53('0xc')](_0xbc53('0xd'),_0x18464b,_0xbc53('0xe'));logger[_0xbc53('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x18464b,_0xbc53('0xe'),JSON[_0xbc53('0x10')](_0x401e4a));if(_0x401e4a['error']){if(_0x401e4a[_0xbc53('0x11')][_0xbc53('0x12')]===0x1f4){logger[_0xbc53('0x11')]('SalesforceField,\x20%s,\x20%s',_0x18464b,_0x401e4a[_0xbc53('0x11')][_0xbc53('0x13')]);return _0x85c8d2(_0x401e4a[_0xbc53('0x11')]['message']);}logger[_0xbc53('0x11')](_0xbc53('0xd'),_0x18464b,_0x401e4a[_0xbc53('0x11')][_0xbc53('0x13')]);return _0x59a9b4(_0x401e4a[_0xbc53('0x11')][_0xbc53('0x13')]);}else{logger['info'](_0xbc53('0xd'),_0x18464b,_0xbc53('0xe'));_0x59a9b4(_0x401e4a[_0xbc53('0x14')][_0xbc53('0x13')]);}})[_0xbc53('0x15')](function(_0x295701){logger[_0xbc53('0x11')]('SalesforceField,\x20%s,\x20%s',_0x18464b,_0x295701);_0x85c8d2(_0x295701);});});}