Built motion from commit 994c64e1.|2.6.1
[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 _0xafce=['request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x154711,_0x3aad3f){var _0x4d823c=function(_0x5271bd){while(--_0x5271bd){_0x154711['push'](_0x154711['shift']());}};_0x4d823c(++_0x3aad3f);}(_0xafce,0xa4));var _0xeafc=function(_0x5260b3,_0x38e8d8){_0x5260b3=_0x5260b3-0x0;var _0x517002=_0xafce[_0x5260b3];return _0x517002;};'use strict';var _=require(_0xeafc('0x0'));var util=require(_0xeafc('0x1'));var moment=require(_0xeafc('0x2'));var BPromise=require(_0xeafc('0x3'));var rs=require(_0xeafc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeafc('0x5'))['db'];var utils=require(_0xeafc('0x6'));var logger=require(_0xeafc('0x7'))(_0xeafc('0x8'));var config=require('../../config/environment');var jayson=require(_0xeafc('0x9'));var client=jayson[_0xeafc('0xa')][_0xeafc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x76e505,_0x1be08a,_0x5e0fdb){return new BPromise(function(_0x13f98a,_0x3e93b4){return client[_0xeafc('0xc')](_0x76e505,_0x5e0fdb)[_0xeafc('0xd')](function(_0x3a7f2e){logger[_0xeafc('0xe')](_0xeafc('0xf'),_0x1be08a,_0xeafc('0x10'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1be08a,_0xeafc('0x10'),JSON['stringify'](_0x3a7f2e));if(_0x3a7f2e['error']){if(_0x3a7f2e[_0xeafc('0x11')][_0xeafc('0x12')]===0x1f4){logger['error'](_0xeafc('0xf'),_0x1be08a,_0x3a7f2e[_0xeafc('0x11')][_0xeafc('0x13')]);return _0x3e93b4(_0x3a7f2e['error'][_0xeafc('0x13')]);}logger[_0xeafc('0x11')](_0xeafc('0xf'),_0x1be08a,_0x3a7f2e[_0xeafc('0x11')]['message']);return _0x13f98a(_0x3a7f2e[_0xeafc('0x11')][_0xeafc('0x13')]);}else{logger[_0xeafc('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1be08a,'request\x20sent');_0x13f98a(_0x3a7f2e['result']['message']);}})['catch'](function(_0x2c0bff){logger[_0xeafc('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1be08a,_0x2c0bff);_0x3e93b4(_0x2c0bff);});});}