Built motion from commit 753c950e.|2.5.42
[motion2.git] / server / api / intSugarcrmField / intSugarcrmField.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 _0x625c=['info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa43518,_0x2a4c6b){var _0x5e9b94=function(_0x3d3c7f){while(--_0x3d3c7f){_0xa43518['push'](_0xa43518['shift']());}};_0x5e9b94(++_0x2a4c6b);}(_0x625c,0x142));var _0xc625=function(_0x58bc74,_0x53dc35){_0x58bc74=_0x58bc74-0x0;var _0x34626b=_0x625c[_0x58bc74];return _0x34626b;};'use strict';var _=require('lodash');var util=require(_0xc625('0x0'));var moment=require(_0xc625('0x1'));var BPromise=require(_0xc625('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc625('0x3'));var db=require(_0xc625('0x4'))['db'];var utils=require(_0xc625('0x5'));var logger=require(_0xc625('0x6'))(_0xc625('0x7'));var config=require('../../config/environment');var jayson=require(_0xc625('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a40e9,_0x3df4df,_0x42c063){return new BPromise(function(_0x38ac10,_0x5a9245){return client[_0xc625('0x9')](_0x5a40e9,_0x42c063)['then'](function(_0x3aef6f){logger['info'](_0xc625('0xa'),_0x3df4df,_0xc625('0xb'));logger[_0xc625('0xc')](_0xc625('0xd'),_0x3df4df,_0xc625('0xb'),JSON[_0xc625('0xe')](_0x3aef6f));if(_0x3aef6f[_0xc625('0xf')]){if(_0x3aef6f[_0xc625('0xf')][_0xc625('0x10')]===0x1f4){logger[_0xc625('0xf')](_0xc625('0xa'),_0x3df4df,_0x3aef6f[_0xc625('0xf')][_0xc625('0x11')]);return _0x5a9245(_0x3aef6f[_0xc625('0xf')][_0xc625('0x11')]);}logger[_0xc625('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x3df4df,_0x3aef6f[_0xc625('0xf')][_0xc625('0x11')]);return _0x38ac10(_0x3aef6f[_0xc625('0xf')]['message']);}else{logger[_0xc625('0x12')](_0xc625('0xa'),_0x3df4df,_0xc625('0xb'));_0x38ac10(_0x3aef6f['result']['message']);}})[_0xc625('0x13')](function(_0x4367c2){logger[_0xc625('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x3df4df,_0x4367c2);_0x5a9245(_0x4367c2);});});}