1913b14b9b0e3745211bcffd6638437eb3521192
[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 _0xb819=['../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x416581,_0x2ecc7e){var _0x197c72=function(_0x5b1a38){while(--_0x5b1a38){_0x416581['push'](_0x416581['shift']());}};_0x197c72(++_0x2ecc7e);}(_0xb819,0xff));var _0x9b81=function(_0x5ddbf1,_0xd08b4){_0x5ddbf1=_0x5ddbf1-0x0;var _0x57918e=_0xb819[_0x5ddbf1];return _0x57918e;};'use strict';var _=require(_0x9b81('0x0'));var util=require(_0x9b81('0x1'));var moment=require(_0x9b81('0x2'));var BPromise=require(_0x9b81('0x3'));var rs=require(_0x9b81('0x4'));var fs=require('fs');var Redis=require(_0x9b81('0x5'));var db=require(_0x9b81('0x6'))['db'];var utils=require(_0x9b81('0x7'));var logger=require('../../config/logger')(_0x9b81('0x8'));var config=require(_0x9b81('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9b81('0xa')][_0x9b81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53962d,_0x58895b,_0x4f94a0){return new BPromise(function(_0x1b3c9a,_0x195ad0){return client[_0x9b81('0xc')](_0x53962d,_0x4f94a0)[_0x9b81('0xd')](function(_0x2bfeb0){logger[_0x9b81('0xe')](_0x9b81('0xf'),_0x58895b,_0x9b81('0x10'));logger['debug'](_0x9b81('0x11'),_0x58895b,_0x9b81('0x10'),JSON[_0x9b81('0x12')](_0x2bfeb0));if(_0x2bfeb0[_0x9b81('0x13')]){if(_0x2bfeb0[_0x9b81('0x13')]['code']===0x1f4){logger[_0x9b81('0x13')]('SalesforceField,\x20%s,\x20%s',_0x58895b,_0x2bfeb0['error']['message']);return _0x195ad0(_0x2bfeb0[_0x9b81('0x13')][_0x9b81('0x14')]);}logger[_0x9b81('0x13')](_0x9b81('0xf'),_0x58895b,_0x2bfeb0[_0x9b81('0x13')]['message']);return _0x1b3c9a(_0x2bfeb0[_0x9b81('0x13')][_0x9b81('0x14')]);}else{logger['info'](_0x9b81('0xf'),_0x58895b,_0x9b81('0x10'));_0x1b3c9a(_0x2bfeb0[_0x9b81('0x15')]['message']);}})['catch'](function(_0x5cc2c4){logger[_0x9b81('0x13')](_0x9b81('0xf'),_0x58895b,_0x5cc2c4);_0x195ad0(_0x5cc2c4);});});}