Built motion from commit (unavailable).|2.5.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 _0x908e=['moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Dynamics365Configuration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash'];(function(_0x3dd242,_0x19e18e){var _0x634b20=function(_0x36b190){while(--_0x36b190){_0x3dd242['push'](_0x3dd242['shift']());}};_0x634b20(++_0x19e18e);}(_0x908e,0x87));var _0xe908=function(_0x32874f,_0x2b45c6){_0x32874f=_0x32874f-0x0;var _0x5a89c6=_0x908e[_0x32874f];return _0x5a89c6;};'use strict';var _=require(_0xe908('0x0'));var util=require('util');var moment=require(_0xe908('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe908('0x2'));var db=require(_0xe908('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe908('0x4'))(_0xe908('0x5'));var config=require(_0xe908('0x6'));var jayson=require(_0xe908('0x7'));var client=jayson['client'][_0xe908('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34d570,_0x5774f2,_0x171500){return new BPromise(function(_0x43e6d3,_0x41d34e){return client['request'](_0x34d570,_0x171500)['then'](function(_0x2fdcc2){logger[_0xe908('0x9')](_0xe908('0xa'),_0x5774f2,'request\x20sent');logger[_0xe908('0xb')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5774f2,_0xe908('0xc'),JSON[_0xe908('0xd')](_0x2fdcc2));if(_0x2fdcc2[_0xe908('0xe')]){if(_0x2fdcc2[_0xe908('0xe')]['code']===0x1f4){logger[_0xe908('0xe')](_0xe908('0xa'),_0x5774f2,_0x2fdcc2[_0xe908('0xe')]['message']);return _0x41d34e(_0x2fdcc2[_0xe908('0xe')][_0xe908('0xf')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x5774f2,_0x2fdcc2[_0xe908('0xe')]['message']);return _0x43e6d3(_0x2fdcc2['error']['message']);}else{logger['info'](_0xe908('0xa'),_0x5774f2,_0xe908('0xc'));_0x43e6d3(_0x2fdcc2[_0xe908('0x10')][_0xe908('0xf')]);}})['catch'](function(_0x8d2358){logger[_0xe908('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5774f2,_0x8d2358);_0x41d34e(_0x8d2358);});});}