Built motion from commit 5ad77b03.|2.6.3
[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 _0x97e2=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','error','code','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x40e48a,_0x5b7b5f){var _0x4bc0b3=function(_0x3ecb42){while(--_0x3ecb42){_0x40e48a['push'](_0x40e48a['shift']());}};_0x4bc0b3(++_0x5b7b5f);}(_0x97e2,0xf7));var _0x297e=function(_0x260347,_0x51b81d){_0x260347=_0x260347-0x0;var _0x299556=_0x97e2[_0x260347];return _0x299556;};'use strict';var _=require(_0x297e('0x0'));var util=require(_0x297e('0x1'));var moment=require(_0x297e('0x2'));var BPromise=require(_0x297e('0x3'));var rs=require(_0x297e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x297e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x297e('0x6'))('rpc');var config=require(_0x297e('0x7'));var jayson=require(_0x297e('0x8'));var client=jayson[_0x297e('0x9')][_0x297e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x407c9e,_0xb6fe08,_0x1ac4a2){return new BPromise(function(_0x168324,_0x1a3a88){return client['request'](_0x407c9e,_0x1ac4a2)[_0x297e('0xb')](function(_0x954a5f){logger['info'](_0x297e('0xc'),_0xb6fe08,_0x297e('0xd'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xb6fe08,_0x297e('0xd'),JSON['stringify'](_0x954a5f));if(_0x954a5f[_0x297e('0xe')]){if(_0x954a5f[_0x297e('0xe')][_0x297e('0xf')]===0x1f4){logger[_0x297e('0xe')](_0x297e('0xc'),_0xb6fe08,_0x954a5f['error'][_0x297e('0x10')]);return _0x1a3a88(_0x954a5f[_0x297e('0xe')][_0x297e('0x10')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xb6fe08,_0x954a5f[_0x297e('0xe')][_0x297e('0x10')]);return _0x168324(_0x954a5f[_0x297e('0xe')][_0x297e('0x10')]);}else{logger[_0x297e('0x11')](_0x297e('0xc'),_0xb6fe08,'request\x20sent');_0x168324(_0x954a5f['result'][_0x297e('0x10')]);}})['catch'](function(_0x1ba5ce){logger[_0x297e('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0xb6fe08,_0x1ba5ce);_0x1a3a88(_0x1ba5ce);});});}