Built motion from commit f94df7f0.|2.5.48
[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 _0xf2b2=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x262323,_0x4a81f1){var _0xa963c3=function(_0x5c715e){while(--_0x5c715e){_0x262323['push'](_0x262323['shift']());}};_0xa963c3(++_0x4a81f1);}(_0xf2b2,0x14a));var _0x2f2b=function(_0x5f0f50,_0x37d4d3){_0x5f0f50=_0x5f0f50-0x0;var _0x3f1d31=_0xf2b2[_0x5f0f50];return _0x3f1d31;};'use strict';var _=require('lodash');var util=require(_0x2f2b('0x0'));var moment=require('moment');var BPromise=require(_0x2f2b('0x1'));var rs=require(_0x2f2b('0x2'));var fs=require('fs');var Redis=require(_0x2f2b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2f2b('0x4'));var logger=require(_0x2f2b('0x5'))('rpc');var config=require(_0x2f2b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2f2b('0x7')][_0x2f2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11bd3a,_0x4a4675,_0x312936){return new BPromise(function(_0x4d28ae,_0x9b3219){return client[_0x2f2b('0x9')](_0x11bd3a,_0x312936)[_0x2f2b('0xa')](function(_0x27b376){logger[_0x2f2b('0xb')](_0x2f2b('0xc'),_0x4a4675,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4a4675,_0x2f2b('0xd'),JSON[_0x2f2b('0xe')](_0x27b376));if(_0x27b376[_0x2f2b('0xf')]){if(_0x27b376['error'][_0x2f2b('0x10')]===0x1f4){logger['error'](_0x2f2b('0xc'),_0x4a4675,_0x27b376[_0x2f2b('0xf')][_0x2f2b('0x11')]);return _0x9b3219(_0x27b376['error'][_0x2f2b('0x11')]);}logger['error'](_0x2f2b('0xc'),_0x4a4675,_0x27b376[_0x2f2b('0xf')][_0x2f2b('0x11')]);return _0x4d28ae(_0x27b376['error'][_0x2f2b('0x11')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4a4675,_0x2f2b('0xd'));_0x4d28ae(_0x27b376[_0x2f2b('0x12')]['message']);}})[_0x2f2b('0x13')](function(_0x1d296c){logger[_0x2f2b('0xf')](_0x2f2b('0xc'),_0x4a4675,_0x1d296c);_0x9b3219(_0x1d296c);});});}