Built motion from commit 753c950e.|2.5.42
[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 _0x45e3=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','moment','bluebird'];(function(_0x4c24bc,_0x2e8d9){var _0x31cf05=function(_0x5de885){while(--_0x5de885){_0x4c24bc['push'](_0x4c24bc['shift']());}};_0x31cf05(++_0x2e8d9);}(_0x45e3,0x1b3));var _0x345e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x45e3[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x345e('0x0'));var BPromise=require(_0x345e('0x1'));var rs=require(_0x345e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x345e('0x3'))['db'];var utils=require(_0x345e('0x4'));var logger=require(_0x345e('0x5'))(_0x345e('0x6'));var config=require(_0x345e('0x7'));var jayson=require(_0x345e('0x8'));var client=jayson[_0x345e('0x9')][_0x345e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1713d5,_0x4a4b22,_0x42bcfd){return new BPromise(function(_0x25f45f,_0x33606a){return client['request'](_0x1713d5,_0x42bcfd)['then'](function(_0x4127fe){logger[_0x345e('0xb')](_0x345e('0xc'),_0x4a4b22,_0x345e('0xd'));logger[_0x345e('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4a4b22,'request\x20sent',JSON[_0x345e('0xf')](_0x4127fe));if(_0x4127fe[_0x345e('0x10')]){if(_0x4127fe['error'][_0x345e('0x11')]===0x1f4){logger[_0x345e('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a4b22,_0x4127fe[_0x345e('0x10')][_0x345e('0x12')]);return _0x33606a(_0x4127fe[_0x345e('0x10')]['message']);}logger[_0x345e('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a4b22,_0x4127fe[_0x345e('0x10')][_0x345e('0x12')]);return _0x25f45f(_0x4127fe[_0x345e('0x10')][_0x345e('0x12')]);}else{logger[_0x345e('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a4b22,_0x345e('0xd'));_0x25f45f(_0x4127fe['result'][_0x345e('0x12')]);}})['catch'](function(_0x5db6bb){logger[_0x345e('0x10')](_0x345e('0xc'),_0x4a4b22,_0x5db6bb);_0x33606a(_0x5db6bb);});});}