Built motion from commit (unavailable).|2.5.23
[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 _0x2a19=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2db303,_0x60570c){var _0xc05bd7=function(_0x244215){while(--_0x244215){_0x2db303['push'](_0x2db303['shift']());}};_0xc05bd7(++_0x60570c);}(_0x2a19,0x78));var _0x92a1=function(_0x3f065d,_0x3553d4){_0x3f065d=_0x3f065d-0x0;var _0x29f45a=_0x2a19[_0x3f065d];return _0x29f45a;};'use strict';var _=require('lodash');var util=require(_0x92a1('0x0'));var moment=require('moment');var BPromise=require(_0x92a1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92a1('0x2'))['db'];var utils=require(_0x92a1('0x3'));var logger=require(_0x92a1('0x4'))(_0x92a1('0x5'));var config=require(_0x92a1('0x6'));var jayson=require(_0x92a1('0x7'));var client=jayson[_0x92a1('0x8')][_0x92a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d86f3,_0x56f07b,_0x1d386d){return new BPromise(function(_0x3da73a,_0x2518e7){return client[_0x92a1('0xa')](_0x5d86f3,_0x1d386d)[_0x92a1('0xb')](function(_0x44fd87){logger['info'](_0x92a1('0xc'),_0x56f07b,_0x92a1('0xd'));logger[_0x92a1('0xe')](_0x92a1('0xf'),_0x56f07b,_0x92a1('0xd'),JSON[_0x92a1('0x10')](_0x44fd87));if(_0x44fd87[_0x92a1('0x11')]){if(_0x44fd87[_0x92a1('0x11')][_0x92a1('0x12')]===0x1f4){logger[_0x92a1('0x11')](_0x92a1('0xc'),_0x56f07b,_0x44fd87[_0x92a1('0x11')][_0x92a1('0x13')]);return _0x2518e7(_0x44fd87['error'][_0x92a1('0x13')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x56f07b,_0x44fd87[_0x92a1('0x11')][_0x92a1('0x13')]);return _0x3da73a(_0x44fd87[_0x92a1('0x11')][_0x92a1('0x13')]);}else{logger[_0x92a1('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x56f07b,_0x92a1('0xd'));_0x3da73a(_0x44fd87[_0x92a1('0x15')][_0x92a1('0x13')]);}})['catch'](function(_0x89cd28){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x56f07b,_0x89cd28);_0x2518e7(_0x89cd28);});});}