Built motion from commit bab6f49e.|2.6.17
[motion2.git] / server / api / intSugarcrmConfiguration / intSugarcrmConfiguration.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 _0x9fbe=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x1a522f,_0x172efe){var _0x2aa18c=function(_0x136bc5){while(--_0x136bc5){_0x1a522f['push'](_0x1a522f['shift']());}};_0x2aa18c(++_0x172efe);}(_0x9fbe,0x152));var _0xe9fb=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x9fbe[_0x5a2299];return _0xedff0f;};'use strict';var _=require(_0xe9fb('0x0'));var util=require(_0xe9fb('0x1'));var moment=require(_0xe9fb('0x2'));var BPromise=require(_0xe9fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9fb('0x4'));var db=require(_0xe9fb('0x5'))['db'];var utils=require(_0xe9fb('0x6'));var logger=require(_0xe9fb('0x7'))('rpc');var config=require(_0xe9fb('0x8'));var jayson=require(_0xe9fb('0x9'));var client=jayson[_0xe9fb('0xa')][_0xe9fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x550182,_0x50edf3,_0x2afccd){return new BPromise(function(_0x59dca6,_0x59cf40){return client['request'](_0x550182,_0x2afccd)[_0xe9fb('0xc')](function(_0x1f5b26){logger[_0xe9fb('0xd')](_0xe9fb('0xe'),_0x50edf3,_0xe9fb('0xf'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x50edf3,_0xe9fb('0xf'),JSON[_0xe9fb('0x10')](_0x1f5b26));if(_0x1f5b26[_0xe9fb('0x11')]){if(_0x1f5b26[_0xe9fb('0x11')][_0xe9fb('0x12')]===0x1f4){logger['error'](_0xe9fb('0xe'),_0x50edf3,_0x1f5b26[_0xe9fb('0x11')][_0xe9fb('0x13')]);return _0x59cf40(_0x1f5b26[_0xe9fb('0x11')][_0xe9fb('0x13')]);}logger[_0xe9fb('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x50edf3,_0x1f5b26[_0xe9fb('0x11')][_0xe9fb('0x13')]);return _0x59dca6(_0x1f5b26[_0xe9fb('0x11')][_0xe9fb('0x13')]);}else{logger[_0xe9fb('0xd')](_0xe9fb('0xe'),_0x50edf3,_0xe9fb('0xf'));_0x59dca6(_0x1f5b26[_0xe9fb('0x14')]['message']);}})[_0xe9fb('0x15')](function(_0x2f4ef4){logger[_0xe9fb('0x11')](_0xe9fb('0xe'),_0x50edf3,_0x2f4ef4);_0x59cf40(_0x2f4ef4);});});}