6158c3035fad3ba564dc15156fe2d2463382a18c
[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 _0x81aa=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x205379,_0x79d618){var _0x1930a4=function(_0x169570){while(--_0x169570){_0x205379['push'](_0x205379['shift']());}};_0x1930a4(++_0x79d618);}(_0x81aa,0xcf));var _0xa81a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x81aa[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xa81a('0x0'));var util=require('util');var moment=require(_0xa81a('0x1'));var BPromise=require(_0xa81a('0x2'));var rs=require(_0xa81a('0x3'));var fs=require('fs');var Redis=require(_0xa81a('0x4'));var db=require(_0xa81a('0x5'))['db'];var utils=require(_0xa81a('0x6'));var logger=require('../../config/logger')(_0xa81a('0x7'));var config=require(_0xa81a('0x8'));var jayson=require(_0xa81a('0x9'));var client=jayson['client'][_0xa81a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210680,_0xf5a22b,_0x725059){return new BPromise(function(_0x1573ad,_0x134606){return client['request'](_0x210680,_0x725059)[_0xa81a('0xb')](function(_0x105beb){logger[_0xa81a('0xc')](_0xa81a('0xd'),_0xf5a22b,'request\x20sent');logger['debug'](_0xa81a('0xe'),_0xf5a22b,_0xa81a('0xf'),JSON[_0xa81a('0x10')](_0x105beb));if(_0x105beb[_0xa81a('0x11')]){if(_0x105beb[_0xa81a('0x11')][_0xa81a('0x12')]===0x1f4){logger[_0xa81a('0x11')](_0xa81a('0xd'),_0xf5a22b,_0x105beb[_0xa81a('0x11')]['message']);return _0x134606(_0x105beb[_0xa81a('0x11')][_0xa81a('0x13')]);}logger['error'](_0xa81a('0xd'),_0xf5a22b,_0x105beb['error'][_0xa81a('0x13')]);return _0x1573ad(_0x105beb['error']['message']);}else{logger[_0xa81a('0xc')](_0xa81a('0xd'),_0xf5a22b,'request\x20sent');_0x1573ad(_0x105beb[_0xa81a('0x14')][_0xa81a('0x13')]);}})['catch'](function(_0x59d42d){logger[_0xa81a('0x11')](_0xa81a('0xd'),_0xf5a22b,_0x59d42d);_0x134606(_0x59d42d);});});}