Built motion from commit (unavailable).|2.5.22
[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 _0x7be9=['code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0xb1786,_0x40502c){var _0x4bab3c=function(_0x419d80){while(--_0x419d80){_0xb1786['push'](_0xb1786['shift']());}};_0x4bab3c(++_0x40502c);}(_0x7be9,0x1a7));var _0x97be=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x7be9[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x97be('0x0'));var util=require('util');var moment=require(_0x97be('0x1'));var BPromise=require('bluebird');var rs=require(_0x97be('0x2'));var fs=require('fs');var Redis=require(_0x97be('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x97be('0x4'));var logger=require('../../config/logger')(_0x97be('0x5'));var config=require(_0x97be('0x6'));var jayson=require(_0x97be('0x7'));var client=jayson[_0x97be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54481b,_0x4ff22e,_0xf15951){return new BPromise(function(_0x58796f,_0xf7f376){return client['request'](_0x54481b,_0xf15951)[_0x97be('0x9')](function(_0x4aedb9){logger['info'](_0x97be('0xa'),_0x4ff22e,'request\x20sent');logger['debug'](_0x97be('0xb'),_0x4ff22e,_0x97be('0xc'),JSON['stringify'](_0x4aedb9));if(_0x4aedb9[_0x97be('0xd')]){if(_0x4aedb9[_0x97be('0xd')][_0x97be('0xe')]===0x1f4){logger[_0x97be('0xd')](_0x97be('0xa'),_0x4ff22e,_0x4aedb9[_0x97be('0xd')][_0x97be('0xf')]);return _0xf7f376(_0x4aedb9[_0x97be('0xd')][_0x97be('0xf')]);}logger[_0x97be('0xd')](_0x97be('0xa'),_0x4ff22e,_0x4aedb9[_0x97be('0xd')][_0x97be('0xf')]);return _0x58796f(_0x4aedb9[_0x97be('0xd')][_0x97be('0xf')]);}else{logger[_0x97be('0x10')](_0x97be('0xa'),_0x4ff22e,_0x97be('0xc'));_0x58796f(_0x4aedb9[_0x97be('0x11')][_0x97be('0xf')]);}})[_0x97be('0x12')](function(_0x26438e){logger['error'](_0x97be('0xa'),_0x4ff22e,_0x26438e);_0xf7f376(_0x26438e);});});}