a70b86e0f94a4404dde84f49fd6212de04a50ce7
[motion2.git] / server / api / intDynamics365Configuration / intDynamics365Configuration.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 _0xdce9=['Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3bfe23,_0x3460b6){var _0x2be493=function(_0x1fd0b5){while(--_0x1fd0b5){_0x3bfe23['push'](_0x3bfe23['shift']());}};_0x2be493(++_0x3460b6);}(_0xdce9,0x9f));var _0x9dce=function(_0x2137c8,_0x1007c){_0x2137c8=_0x2137c8-0x0;var _0x26ccc7=_0xdce9[_0x2137c8];return _0x26ccc7;};'use strict';var _=require(_0x9dce('0x0'));var util=require(_0x9dce('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9dce('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dce('0x3'))['db'];var utils=require(_0x9dce('0x4'));var logger=require('../../config/logger')(_0x9dce('0x5'));var config=require(_0x9dce('0x6'));var jayson=require(_0x9dce('0x7'));var client=jayson[_0x9dce('0x8')][_0x9dce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451d22,_0x196b3f,_0x2c8751){return new BPromise(function(_0x2db652,_0x1db524){return client['request'](_0x451d22,_0x2c8751)[_0x9dce('0xa')](function(_0x18ee42){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x196b3f,_0x9dce('0xb'));logger[_0x9dce('0xc')](_0x9dce('0xd'),_0x196b3f,_0x9dce('0xb'),JSON[_0x9dce('0xe')](_0x18ee42));if(_0x18ee42['error']){if(_0x18ee42[_0x9dce('0xf')][_0x9dce('0x10')]===0x1f4){logger['error'](_0x9dce('0x11'),_0x196b3f,_0x18ee42[_0x9dce('0xf')][_0x9dce('0x12')]);return _0x1db524(_0x18ee42[_0x9dce('0xf')]['message']);}logger[_0x9dce('0xf')](_0x9dce('0x11'),_0x196b3f,_0x18ee42[_0x9dce('0xf')][_0x9dce('0x12')]);return _0x2db652(_0x18ee42[_0x9dce('0xf')][_0x9dce('0x12')]);}else{logger[_0x9dce('0x13')](_0x9dce('0x11'),_0x196b3f,'request\x20sent');_0x2db652(_0x18ee42[_0x9dce('0x14')][_0x9dce('0x12')]);}})[_0x9dce('0x15')](function(_0x1232f0){logger[_0x9dce('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x196b3f,_0x1232f0);_0x1db524(_0x1232f0);});});}