Built motion from commit (unavailable).|2.4.4
[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 _0xa532=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error'];(function(_0x51eaa4,_0x599324){var _0x183ebb=function(_0x400cee){while(--_0x400cee){_0x51eaa4['push'](_0x51eaa4['shift']());}};_0x183ebb(++_0x599324);}(_0xa532,0x17a));var _0x2a53=function(_0x485952,_0x8fb6b1){_0x485952=_0x485952-0x0;var _0x11b491=_0xa532[_0x485952];return _0x11b491;};'use strict';var _=require(_0x2a53('0x0'));var util=require('util');var moment=require(_0x2a53('0x1'));var BPromise=require(_0x2a53('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a53('0x3'));var db=require(_0x2a53('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a53('0x5'))(_0x2a53('0x6'));var config=require(_0x2a53('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2a53('0x8')][_0x2a53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3139af,_0x343d15,_0x4b2c78){return new BPromise(function(_0x584c2a,_0x35504a){return client[_0x2a53('0xa')](_0x3139af,_0x4b2c78)[_0x2a53('0xb')](function(_0x333e68){logger[_0x2a53('0xc')](_0x2a53('0xd'),_0x343d15,_0x2a53('0xe'));logger[_0x2a53('0xf')](_0x2a53('0x10'),_0x343d15,_0x2a53('0xe'),JSON['stringify'](_0x333e68));if(_0x333e68[_0x2a53('0x11')]){if(_0x333e68['error'][_0x2a53('0x12')]===0x1f4){logger[_0x2a53('0x11')](_0x2a53('0xd'),_0x343d15,_0x333e68[_0x2a53('0x11')][_0x2a53('0x13')]);return _0x35504a(_0x333e68[_0x2a53('0x11')][_0x2a53('0x13')]);}logger['error'](_0x2a53('0xd'),_0x343d15,_0x333e68[_0x2a53('0x11')][_0x2a53('0x13')]);return _0x584c2a(_0x333e68['error']['message']);}else{logger[_0x2a53('0xc')](_0x2a53('0xd'),_0x343d15,_0x2a53('0xe'));_0x584c2a(_0x333e68[_0x2a53('0x14')][_0x2a53('0x13')]);}})[_0x2a53('0x15')](function(_0x55bbc5){logger['error'](_0x2a53('0xd'),_0x343d15,_0x55bbc5);_0x35504a(_0x55bbc5);});});}