e47c908e9a5e434d0a37dc862b5c732e3e46fd12
[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 _0x9c1a=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x9c1a,0xeb));var _0xa9c1=function(_0x1e1f17,_0x4bd574){_0x1e1f17=_0x1e1f17-0x0;var _0x465b52=_0x9c1a[_0x1e1f17];return _0x465b52;};'use strict';var _=require('lodash');var util=require(_0xa9c1('0x0'));var moment=require(_0xa9c1('0x1'));var BPromise=require(_0xa9c1('0x2'));var rs=require(_0xa9c1('0x3'));var fs=require('fs');var Redis=require(_0xa9c1('0x4'));var db=require(_0xa9c1('0x5'))['db'];var utils=require(_0xa9c1('0x6'));var logger=require(_0xa9c1('0x7'))('rpc');var config=require(_0xa9c1('0x8'));var jayson=require(_0xa9c1('0x9'));var client=jayson[_0xa9c1('0xa')][_0xa9c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cf314,_0x4511b9,_0x487616){return new BPromise(function(_0x3b2cbe,_0x21287b){return client[_0xa9c1('0xc')](_0x2cf314,_0x487616)[_0xa9c1('0xd')](function(_0x54ff69){logger[_0xa9c1('0xe')](_0xa9c1('0xf'),_0x4511b9,'request\x20sent');logger['debug'](_0xa9c1('0x10'),_0x4511b9,_0xa9c1('0x11'),JSON[_0xa9c1('0x12')](_0x54ff69));if(_0x54ff69['error']){if(_0x54ff69[_0xa9c1('0x13')][_0xa9c1('0x14')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4511b9,_0x54ff69['error'][_0xa9c1('0x15')]);return _0x21287b(_0x54ff69[_0xa9c1('0x13')]['message']);}logger['error'](_0xa9c1('0xf'),_0x4511b9,_0x54ff69[_0xa9c1('0x13')][_0xa9c1('0x15')]);return _0x3b2cbe(_0x54ff69[_0xa9c1('0x13')][_0xa9c1('0x15')]);}else{logger[_0xa9c1('0xe')](_0xa9c1('0xf'),_0x4511b9,'request\x20sent');_0x3b2cbe(_0x54ff69[_0xa9c1('0x16')][_0xa9c1('0x15')]);}})[_0xa9c1('0x17')](function(_0x6a9e3c){logger[_0xa9c1('0x13')](_0xa9c1('0xf'),_0x4511b9,_0x6a9e3c);_0x21287b(_0x6a9e3c);});});}