0f7558b2bd4d97e72fdc2cd9943f9b09e5bab26d
[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 _0x954e=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x3cb9b2,_0x35468b){var _0x5001f1=function(_0xd8498c){while(--_0xd8498c){_0x3cb9b2['push'](_0x3cb9b2['shift']());}};_0x5001f1(++_0x35468b);}(_0x954e,0x1cf));var _0xe954=function(_0x5e836a,_0x156644){_0x5e836a=_0x5e836a-0x0;var _0x484835=_0x954e[_0x5e836a];return _0x484835;};'use strict';var _=require(_0xe954('0x0'));var util=require(_0xe954('0x1'));var moment=require(_0xe954('0x2'));var BPromise=require('bluebird');var rs=require(_0xe954('0x3'));var fs=require('fs');var Redis=require(_0xe954('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe954('0x5'));var logger=require(_0xe954('0x6'))(_0xe954('0x7'));var config=require(_0xe954('0x8'));var jayson=require(_0xe954('0x9'));var client=jayson[_0xe954('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1facf4,_0xa62967,_0x5cccba){return new BPromise(function(_0x227ee8,_0x5a4aa3){return client[_0xe954('0xb')](_0x1facf4,_0x5cccba)[_0xe954('0xc')](function(_0x440794){logger[_0xe954('0xd')](_0xe954('0xe'),_0xa62967,_0xe954('0xf'));logger[_0xe954('0x10')](_0xe954('0x11'),_0xa62967,_0xe954('0xf'),JSON['stringify'](_0x440794));if(_0x440794['error']){if(_0x440794[_0xe954('0x12')]['code']===0x1f4){logger[_0xe954('0x12')]('SalesforceField,\x20%s,\x20%s',_0xa62967,_0x440794[_0xe954('0x12')][_0xe954('0x13')]);return _0x5a4aa3(_0x440794[_0xe954('0x12')][_0xe954('0x13')]);}logger['error'](_0xe954('0xe'),_0xa62967,_0x440794['error'][_0xe954('0x13')]);return _0x227ee8(_0x440794[_0xe954('0x12')][_0xe954('0x13')]);}else{logger[_0xe954('0xd')](_0xe954('0xe'),_0xa62967,_0xe954('0xf'));_0x227ee8(_0x440794[_0xe954('0x14')][_0xe954('0x13')]);}})[_0xe954('0x15')](function(_0x3f535c){logger[_0xe954('0x12')]('SalesforceField,\x20%s,\x20%s',_0xa62967,_0x3f535c);_0x5a4aa3(_0x3f535c);});});}