Built motion from commit da617fac.|2.6.6
[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 _0x1be0=['info','request\x20sent','debug','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1be0,0x1ad));var _0x01be=function(_0xfc55f1,_0x7825bc){_0xfc55f1=_0xfc55f1-0x0;var _0x5000f1=_0x1be0[_0xfc55f1];return _0x5000f1;};'use strict';var _=require(_0x01be('0x0'));var util=require(_0x01be('0x1'));var moment=require(_0x01be('0x2'));var BPromise=require('bluebird');var rs=require(_0x01be('0x3'));var fs=require('fs');var Redis=require(_0x01be('0x4'));var db=require(_0x01be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x01be('0x6'))('rpc');var config=require(_0x01be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x01be('0x8')][_0x01be('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ab2ed,_0x43b61a,_0x39b235){return new BPromise(function(_0x4f606f,_0x4d43c9){return client['request'](_0x1ab2ed,_0x39b235)[_0x01be('0xa')](function(_0x2f1010){logger[_0x01be('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43b61a,_0x01be('0xc'));logger[_0x01be('0xd')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x43b61a,_0x01be('0xc'),JSON[_0x01be('0xe')](_0x2f1010));if(_0x2f1010[_0x01be('0xf')]){if(_0x2f1010[_0x01be('0xf')][_0x01be('0x10')]===0x1f4){logger[_0x01be('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x43b61a,_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);return _0x4d43c9(_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);}logger[_0x01be('0xf')](_0x01be('0x12'),_0x43b61a,_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);return _0x4f606f(_0x2f1010[_0x01be('0xf')][_0x01be('0x11')]);}else{logger[_0x01be('0xb')](_0x01be('0x12'),_0x43b61a,_0x01be('0xc'));_0x4f606f(_0x2f1010['result']['message']);}})[_0x01be('0x13')](function(_0x3e1960){logger[_0x01be('0xf')](_0x01be('0x12'),_0x43b61a,_0x3e1960);_0x4d43c9(_0x3e1960);});});}