Built motion from commit f7863d46.|2.5.41
[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 _0xcf12=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2406e1,_0x3de77f){var _0x1c30ff=function(_0x4be221){while(--_0x4be221){_0x2406e1['push'](_0x2406e1['shift']());}};_0x1c30ff(++_0x3de77f);}(_0xcf12,0x169));var _0x2cf1=function(_0x3a3a4b,_0x290d97){_0x3a3a4b=_0x3a3a4b-0x0;var _0x367b71=_0xcf12[_0x3a3a4b];return _0x367b71;};'use strict';var _=require(_0x2cf1('0x0'));var util=require(_0x2cf1('0x1'));var moment=require(_0x2cf1('0x2'));var BPromise=require(_0x2cf1('0x3'));var rs=require(_0x2cf1('0x4'));var fs=require('fs');var Redis=require(_0x2cf1('0x5'));var db=require(_0x2cf1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cf1('0x7'))(_0x2cf1('0x8'));var config=require(_0x2cf1('0x9'));var jayson=require(_0x2cf1('0xa'));var client=jayson['client'][_0x2cf1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d5cf3,_0x4ebfc8,_0x2370d6){return new BPromise(function(_0xe15cb2,_0x4151d5){return client[_0x2cf1('0xc')](_0x5d5cf3,_0x2370d6)[_0x2cf1('0xd')](function(_0x380adb){logger[_0x2cf1('0xe')](_0x2cf1('0xf'),_0x4ebfc8,'request\x20sent');logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4ebfc8,'request\x20sent',JSON[_0x2cf1('0x10')](_0x380adb));if(_0x380adb[_0x2cf1('0x11')]){if(_0x380adb[_0x2cf1('0x11')][_0x2cf1('0x12')]===0x1f4){logger['error'](_0x2cf1('0xf'),_0x4ebfc8,_0x380adb['error']['message']);return _0x4151d5(_0x380adb[_0x2cf1('0x11')][_0x2cf1('0x13')]);}logger[_0x2cf1('0x11')](_0x2cf1('0xf'),_0x4ebfc8,_0x380adb[_0x2cf1('0x11')][_0x2cf1('0x13')]);return _0xe15cb2(_0x380adb[_0x2cf1('0x11')][_0x2cf1('0x13')]);}else{logger[_0x2cf1('0xe')](_0x2cf1('0xf'),_0x4ebfc8,_0x2cf1('0x14'));_0xe15cb2(_0x380adb[_0x2cf1('0x15')][_0x2cf1('0x13')]);}})[_0x2cf1('0x16')](function(_0x92b38c){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4ebfc8,_0x92b38c);_0x4151d5(_0x92b38c);});});}