e346d7f2a57bf107b9558c695895eb0d1408cec8
[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 _0x7e18=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x42bbe9,_0x29ca1d){var _0x23910e=function(_0x147969){while(--_0x147969){_0x42bbe9['push'](_0x42bbe9['shift']());}};_0x23910e(++_0x29ca1d);}(_0x7e18,0x17a));var _0x87e1=function(_0x5e3d4a,_0x41e4cb){_0x5e3d4a=_0x5e3d4a-0x0;var _0x18ec7c=_0x7e18[_0x5e3d4a];return _0x18ec7c;};'use strict';var _=require(_0x87e1('0x0'));var util=require(_0x87e1('0x1'));var moment=require(_0x87e1('0x2'));var BPromise=require(_0x87e1('0x3'));var rs=require(_0x87e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87e1('0x5'))['db'];var utils=require(_0x87e1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x87e1('0x7'));var jayson=require(_0x87e1('0x8'));var client=jayson[_0x87e1('0x9')][_0x87e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ae213,_0x1a4261,_0x5f0e0c){return new BPromise(function(_0x26af1c,_0x256db5){return client[_0x87e1('0xb')](_0x4ae213,_0x5f0e0c)[_0x87e1('0xc')](function(_0x578825){logger[_0x87e1('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a4261,_0x87e1('0xe'));logger[_0x87e1('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x1a4261,'request\x20sent',JSON[_0x87e1('0x10')](_0x578825));if(_0x578825[_0x87e1('0x11')]){if(_0x578825[_0x87e1('0x11')][_0x87e1('0x12')]===0x1f4){logger[_0x87e1('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a4261,_0x578825[_0x87e1('0x11')]['message']);return _0x256db5(_0x578825[_0x87e1('0x11')]['message']);}logger[_0x87e1('0x11')](_0x87e1('0x13'),_0x1a4261,_0x578825[_0x87e1('0x11')][_0x87e1('0x14')]);return _0x26af1c(_0x578825['error'][_0x87e1('0x14')]);}else{logger[_0x87e1('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1a4261,_0x87e1('0xe'));_0x26af1c(_0x578825['result'][_0x87e1('0x14')]);}})['catch'](function(_0x5b1b89){logger[_0x87e1('0x11')](_0x87e1('0x13'),_0x1a4261,_0x5b1b89);_0x256db5(_0x5b1b89);});});}