Built motion from commit (unavailable).|2.5.0
[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 _0xdbf6=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug'];(function(_0x342c3d,_0x538b21){var _0x131531=function(_0x88f4b){while(--_0x88f4b){_0x342c3d['push'](_0x342c3d['shift']());}};_0x131531(++_0x538b21);}(_0xdbf6,0x146));var _0x6dbf=function(_0x406c64,_0x14fbf4){_0x406c64=_0x406c64-0x0;var _0x2b5f80=_0xdbf6[_0x406c64];return _0x2b5f80;};'use strict';var _=require('lodash');var util=require(_0x6dbf('0x0'));var moment=require('moment');var BPromise=require(_0x6dbf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dbf('0x2'))['db'];var utils=require(_0x6dbf('0x3'));var logger=require('../../config/logger')(_0x6dbf('0x4'));var config=require(_0x6dbf('0x5'));var jayson=require(_0x6dbf('0x6'));var client=jayson[_0x6dbf('0x7')][_0x6dbf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25ba15,_0x398e0b,_0x47d5c4){return new BPromise(function(_0x15b8aa,_0x3afde2){return client[_0x6dbf('0x9')](_0x25ba15,_0x47d5c4)[_0x6dbf('0xa')](function(_0x59f4b5){logger[_0x6dbf('0xb')](_0x6dbf('0xc'),_0x398e0b,'request\x20sent');logger[_0x6dbf('0xd')](_0x6dbf('0xe'),_0x398e0b,_0x6dbf('0xf'),JSON['stringify'](_0x59f4b5));if(_0x59f4b5[_0x6dbf('0x10')]){if(_0x59f4b5[_0x6dbf('0x10')]['code']===0x1f4){logger[_0x6dbf('0x10')](_0x6dbf('0xc'),_0x398e0b,_0x59f4b5[_0x6dbf('0x10')][_0x6dbf('0x11')]);return _0x3afde2(_0x59f4b5['error'][_0x6dbf('0x11')]);}logger[_0x6dbf('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x398e0b,_0x59f4b5['error'][_0x6dbf('0x11')]);return _0x15b8aa(_0x59f4b5[_0x6dbf('0x10')]['message']);}else{logger[_0x6dbf('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x398e0b,_0x6dbf('0xf'));_0x15b8aa(_0x59f4b5[_0x6dbf('0x12')][_0x6dbf('0x11')]);}})[_0x6dbf('0x13')](function(_0x4d1b07){logger[_0x6dbf('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x398e0b,_0x4d1b07);_0x3afde2(_0x4d1b07);});});}