Built motion from commit b5413ace.|2.6.9
[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 _0xf8eb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x22dd6a,_0x30281c){var _0x1cec74=function(_0x2a3ed8){while(--_0x2a3ed8){_0x22dd6a['push'](_0x22dd6a['shift']());}};_0x1cec74(++_0x30281c);}(_0xf8eb,0x1dd));var _0xbf8e=function(_0x54c68,_0x288724){_0x54c68=_0x54c68-0x0;var _0x482e5d=_0xf8eb[_0x54c68];return _0x482e5d;};'use strict';var _=require(_0xbf8e('0x0'));var util=require(_0xbf8e('0x1'));var moment=require(_0xbf8e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf8e('0x3'));var db=require(_0xbf8e('0x4'))['db'];var utils=require(_0xbf8e('0x5'));var logger=require(_0xbf8e('0x6'))(_0xbf8e('0x7'));var config=require(_0xbf8e('0x8'));var jayson=require(_0xbf8e('0x9'));var client=jayson[_0xbf8e('0xa')][_0xbf8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4846bf,_0x1c0d41,_0x44955a){return new BPromise(function(_0x25402a,_0x451c4c){return client[_0xbf8e('0xc')](_0x4846bf,_0x44955a)[_0xbf8e('0xd')](function(_0x5e70e4){logger[_0xbf8e('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x1c0d41,_0xbf8e('0xf'));logger[_0xbf8e('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1c0d41,_0xbf8e('0xf'),JSON['stringify'](_0x5e70e4));if(_0x5e70e4['error']){if(_0x5e70e4[_0xbf8e('0x11')][_0xbf8e('0x12')]===0x1f4){logger[_0xbf8e('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1c0d41,_0x5e70e4['error']['message']);return _0x451c4c(_0x5e70e4[_0xbf8e('0x11')][_0xbf8e('0x13')]);}logger[_0xbf8e('0x11')](_0xbf8e('0x14'),_0x1c0d41,_0x5e70e4[_0xbf8e('0x11')][_0xbf8e('0x13')]);return _0x25402a(_0x5e70e4[_0xbf8e('0x11')][_0xbf8e('0x13')]);}else{logger[_0xbf8e('0xe')](_0xbf8e('0x14'),_0x1c0d41,'request\x20sent');_0x25402a(_0x5e70e4[_0xbf8e('0x15')][_0xbf8e('0x13')]);}})[_0xbf8e('0x16')](function(_0x62b3e1){logger[_0xbf8e('0x11')](_0xbf8e('0x14'),_0x1c0d41,_0x62b3e1);_0x451c4c(_0x62b3e1);});});}