Built motion from commit fa4c4286.|2.6.29
[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 _0xb091=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb091,0xb8));var _0x1b09=function(_0x7d0ce7,_0x13f308){_0x7d0ce7=_0x7d0ce7-0x0;var _0x183ed5=_0xb091[_0x7d0ce7];return _0x183ed5;};'use strict';var _=require(_0x1b09('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1b09('0x1'));var rs=require(_0x1b09('0x2'));var fs=require('fs');var Redis=require(_0x1b09('0x3'));var db=require(_0x1b09('0x4'))['db'];var utils=require(_0x1b09('0x5'));var logger=require('../../config/logger')(_0x1b09('0x6'));var config=require(_0x1b09('0x7'));var jayson=require(_0x1b09('0x8'));var client=jayson['client'][_0x1b09('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e1085,_0x3399c7,_0xa540f8){return new BPromise(function(_0x4ba2a4,_0xa0f507){return client[_0x1b09('0xa')](_0x1e1085,_0xa540f8)[_0x1b09('0xb')](function(_0x2afb8f){logger['info'](_0x1b09('0xc'),_0x3399c7,'request\x20sent');logger['debug'](_0x1b09('0xd'),_0x3399c7,'request\x20sent',JSON[_0x1b09('0xe')](_0x2afb8f));if(_0x2afb8f[_0x1b09('0xf')]){if(_0x2afb8f[_0x1b09('0xf')][_0x1b09('0x10')]===0x1f4){logger[_0x1b09('0xf')](_0x1b09('0xc'),_0x3399c7,_0x2afb8f[_0x1b09('0xf')][_0x1b09('0x11')]);return _0xa0f507(_0x2afb8f[_0x1b09('0xf')][_0x1b09('0x11')]);}logger[_0x1b09('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3399c7,_0x2afb8f['error'][_0x1b09('0x11')]);return _0x4ba2a4(_0x2afb8f[_0x1b09('0xf')]['message']);}else{logger[_0x1b09('0x12')](_0x1b09('0xc'),_0x3399c7,_0x1b09('0x13'));_0x4ba2a4(_0x2afb8f['result'][_0x1b09('0x11')]);}})[_0x1b09('0x14')](function(_0x1a4c9c){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3399c7,_0x1a4c9c);_0xa0f507(_0x1a4c9c);});});}