Built motion from commit 1fa89557.|2.6.10
[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 _0x36f6=['message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x36f6,0x17d));var _0x636f=function(_0x1840b1,_0x2d021e){_0x1840b1=_0x1840b1-0x0;var _0x54ee73=_0x36f6[_0x1840b1];return _0x54ee73;};'use strict';var _=require(_0x636f('0x0'));var util=require('util');var moment=require(_0x636f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x636f('0x2'));var db=require(_0x636f('0x3'))['db'];var utils=require(_0x636f('0x4'));var logger=require(_0x636f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x636f('0x6'));var client=jayson[_0x636f('0x7')][_0x636f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cb028,_0xe4970e,_0x453e8d){return new BPromise(function(_0x177b6d,_0x235aac){return client[_0x636f('0x9')](_0x4cb028,_0x453e8d)[_0x636f('0xa')](function(_0xda4f67){logger[_0x636f('0xb')]('SalesforceField,\x20%s,\x20%s',_0xe4970e,_0x636f('0xc'));logger[_0x636f('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0xe4970e,_0x636f('0xc'),JSON[_0x636f('0xe')](_0xda4f67));if(_0xda4f67[_0x636f('0xf')]){if(_0xda4f67[_0x636f('0xf')][_0x636f('0x10')]===0x1f4){logger[_0x636f('0xf')](_0x636f('0x11'),_0xe4970e,_0xda4f67[_0x636f('0xf')][_0x636f('0x12')]);return _0x235aac(_0xda4f67[_0x636f('0xf')][_0x636f('0x12')]);}logger[_0x636f('0xf')](_0x636f('0x11'),_0xe4970e,_0xda4f67['error'][_0x636f('0x12')]);return _0x177b6d(_0xda4f67[_0x636f('0xf')][_0x636f('0x12')]);}else{logger[_0x636f('0xb')](_0x636f('0x11'),_0xe4970e,_0x636f('0xc'));_0x177b6d(_0xda4f67[_0x636f('0x13')][_0x636f('0x12')]);}})[_0x636f('0x14')](function(_0x1c3a13){logger[_0x636f('0xf')](_0x636f('0x11'),_0xe4970e,_0x1c3a13);_0x235aac(_0x1c3a13);});});}