Built motion from commit da617fac.|2.6.6
[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 _0xfe26=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2efe4f,_0x35b3d9){var _0x251e7e=function(_0x56be52){while(--_0x56be52){_0x2efe4f['push'](_0x2efe4f['shift']());}};_0x251e7e(++_0x35b3d9);}(_0xfe26,0x65));var _0x6fe2=function(_0x215718,_0x1762f3){_0x215718=_0x215718-0x0;var _0x379fa1=_0xfe26[_0x215718];return _0x379fa1;};'use strict';var _=require(_0x6fe2('0x0'));var util=require('util');var moment=require(_0x6fe2('0x1'));var BPromise=require(_0x6fe2('0x2'));var rs=require(_0x6fe2('0x3'));var fs=require('fs');var Redis=require(_0x6fe2('0x4'));var db=require(_0x6fe2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fe2('0x6'))(_0x6fe2('0x7'));var config=require(_0x6fe2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6fe2('0x9')][_0x6fe2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a99b0,_0x3a30bb,_0x59baba){return new BPromise(function(_0x18370f,_0x39e83e){return client[_0x6fe2('0xb')](_0x4a99b0,_0x59baba)[_0x6fe2('0xc')](function(_0x2f37c6){logger[_0x6fe2('0xd')](_0x6fe2('0xe'),_0x3a30bb,_0x6fe2('0xf'));logger[_0x6fe2('0x10')](_0x6fe2('0x11'),_0x3a30bb,_0x6fe2('0xf'),JSON[_0x6fe2('0x12')](_0x2f37c6));if(_0x2f37c6[_0x6fe2('0x13')]){if(_0x2f37c6['error'][_0x6fe2('0x14')]===0x1f4){logger['error'](_0x6fe2('0xe'),_0x3a30bb,_0x2f37c6['error'][_0x6fe2('0x15')]);return _0x39e83e(_0x2f37c6[_0x6fe2('0x13')]['message']);}logger[_0x6fe2('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3a30bb,_0x2f37c6[_0x6fe2('0x13')]['message']);return _0x18370f(_0x2f37c6[_0x6fe2('0x13')]['message']);}else{logger[_0x6fe2('0xd')](_0x6fe2('0xe'),_0x3a30bb,'request\x20sent');_0x18370f(_0x2f37c6[_0x6fe2('0x16')][_0x6fe2('0x15')]);}})['catch'](function(_0xba477f){logger[_0x6fe2('0x13')](_0x6fe2('0xe'),_0x3a30bb,_0xba477f);_0x39e83e(_0xba477f);});});}