Built motion from commit (unavailable).|2.5.11
[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 _0xad43=['../../mysqldb','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5490ce,_0x2add99){var _0x3e8a50=function(_0x222923){while(--_0x222923){_0x5490ce['push'](_0x5490ce['shift']());}};_0x3e8a50(++_0x2add99);}(_0xad43,0x1dd));var _0x3ad4=function(_0x1fdb57,_0xfdac8f){_0x1fdb57=_0x1fdb57-0x0;var _0x51bb03=_0xad43[_0x1fdb57];return _0x51bb03;};'use strict';var _=require(_0x3ad4('0x0'));var util=require(_0x3ad4('0x1'));var moment=require(_0x3ad4('0x2'));var BPromise=require(_0x3ad4('0x3'));var rs=require(_0x3ad4('0x4'));var fs=require('fs');var Redis=require(_0x3ad4('0x5'));var db=require(_0x3ad4('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3ad4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2cafcb,_0x152c07,_0x22a9e5){return new BPromise(function(_0x2a57ce,_0x5ebabb){return client[_0x3ad4('0x8')](_0x2cafcb,_0x22a9e5)[_0x3ad4('0x9')](function(_0x49e7ac){logger[_0x3ad4('0xa')](_0x3ad4('0xb'),_0x152c07,_0x3ad4('0xc'));logger[_0x3ad4('0xd')](_0x3ad4('0xe'),_0x152c07,_0x3ad4('0xc'),JSON[_0x3ad4('0xf')](_0x49e7ac));if(_0x49e7ac['error']){if(_0x49e7ac['error'][_0x3ad4('0x10')]===0x1f4){logger['error'](_0x3ad4('0xb'),_0x152c07,_0x49e7ac[_0x3ad4('0x11')][_0x3ad4('0x12')]);return _0x5ebabb(_0x49e7ac[_0x3ad4('0x11')]['message']);}logger['error'](_0x3ad4('0xb'),_0x152c07,_0x49e7ac[_0x3ad4('0x11')]['message']);return _0x2a57ce(_0x49e7ac[_0x3ad4('0x11')][_0x3ad4('0x12')]);}else{logger[_0x3ad4('0xa')](_0x3ad4('0xb'),_0x152c07,'request\x20sent');_0x2a57ce(_0x49e7ac[_0x3ad4('0x13')]['message']);}})[_0x3ad4('0x14')](function(_0x5074f5){logger[_0x3ad4('0x11')](_0x3ad4('0xb'),_0x152c07,_0x5074f5);_0x5ebabb(_0x5074f5);});});}