Built motion from commit ddca4d0d.|2.5.47
[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 _0x06ce=['error','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x06ce,0x124));var _0xe06c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x06ce[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xe06c('0x0'));var util=require(_0xe06c('0x1'));var moment=require(_0xe06c('0x2'));var BPromise=require(_0xe06c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe06c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe06c('0x5'));var logger=require('../../config/logger')(_0xe06c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe06c('0x7')][_0xe06c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55630c,_0x193be9,_0x2ddeea){return new BPromise(function(_0x549f8e,_0x2982ae){return client[_0xe06c('0x9')](_0x55630c,_0x2ddeea)[_0xe06c('0xa')](function(_0x4bdad2){logger['info'](_0xe06c('0xb'),_0x193be9,_0xe06c('0xc'));logger['debug'](_0xe06c('0xd'),_0x193be9,_0xe06c('0xc'),JSON['stringify'](_0x4bdad2));if(_0x4bdad2[_0xe06c('0xe')]){if(_0x4bdad2['error']['code']===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x193be9,_0x4bdad2['error']['message']);return _0x2982ae(_0x4bdad2[_0xe06c('0xe')][_0xe06c('0xf')]);}logger[_0xe06c('0xe')](_0xe06c('0xb'),_0x193be9,_0x4bdad2[_0xe06c('0xe')][_0xe06c('0xf')]);return _0x549f8e(_0x4bdad2[_0xe06c('0xe')]['message']);}else{logger[_0xe06c('0x10')]('SalesforceField,\x20%s,\x20%s',_0x193be9,_0xe06c('0xc'));_0x549f8e(_0x4bdad2[_0xe06c('0x11')][_0xe06c('0xf')]);}})['catch'](function(_0x46cd35){logger[_0xe06c('0xe')](_0xe06c('0xb'),_0x193be9,_0x46cd35);_0x2982ae(_0x46cd35);});});}