3b9e60786be2f46df2c1b21f0324549f5b56df6a
[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 _0x395f=['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','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x395f,0x6a));var _0xf395=function(_0x12e682,_0x33f3a3){_0x12e682=_0x12e682-0x0;var _0x26e600=_0x395f[_0x12e682];return _0x26e600;};'use strict';var _=require(_0xf395('0x0'));var util=require(_0xf395('0x1'));var moment=require(_0xf395('0x2'));var BPromise=require(_0xf395('0x3'));var rs=require(_0xf395('0x4'));var fs=require('fs');var Redis=require(_0xf395('0x5'));var db=require(_0xf395('0x6'))['db'];var utils=require(_0xf395('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf395('0x8'));var jayson=require(_0xf395('0x9'));var client=jayson[_0xf395('0xa')][_0xf395('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38d41a,_0x5fdc0,_0x2d2005){return new BPromise(function(_0x32695e,_0x1fde35){return client[_0xf395('0xc')](_0x38d41a,_0x2d2005)[_0xf395('0xd')](function(_0x18d2c7){logger[_0xf395('0xe')](_0xf395('0xf'),_0x5fdc0,'request\x20sent');logger['debug'](_0xf395('0x10'),_0x5fdc0,_0xf395('0x11'),JSON[_0xf395('0x12')](_0x18d2c7));if(_0x18d2c7['error']){if(_0x18d2c7[_0xf395('0x13')][_0xf395('0x14')]===0x1f4){logger[_0xf395('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5fdc0,_0x18d2c7[_0xf395('0x13')][_0xf395('0x15')]);return _0x1fde35(_0x18d2c7[_0xf395('0x13')][_0xf395('0x15')]);}logger[_0xf395('0x13')](_0xf395('0xf'),_0x5fdc0,_0x18d2c7[_0xf395('0x13')][_0xf395('0x15')]);return _0x32695e(_0x18d2c7[_0xf395('0x13')][_0xf395('0x15')]);}else{logger[_0xf395('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5fdc0,_0xf395('0x11'));_0x32695e(_0x18d2c7[_0xf395('0x16')][_0xf395('0x15')]);}})['catch'](function(_0x32e415){logger[_0xf395('0x13')](_0xf395('0xf'),_0x5fdc0,_0x32e415);_0x1fde35(_0x32e415);});});}