f76f8ef8d31913bdfcde589b65736124f04d71be
[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 _0x77e5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','Dynamics365Configuration,\x20%s,\x20%s','lodash','util'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0x77e5,0xc6));var _0x577e=function(_0x5baa75,_0x3c2d52){_0x5baa75=_0x5baa75-0x0;var _0x3030aa=_0x77e5[_0x5baa75];return _0x3030aa;};'use strict';var _=require(_0x577e('0x0'));var util=require(_0x577e('0x1'));var moment=require(_0x577e('0x2'));var BPromise=require(_0x577e('0x3'));var rs=require(_0x577e('0x4'));var fs=require('fs');var Redis=require(_0x577e('0x5'));var db=require(_0x577e('0x6'))['db'];var utils=require(_0x577e('0x7'));var logger=require(_0x577e('0x8'))(_0x577e('0x9'));var config=require(_0x577e('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2834b5,_0x1da321,_0xa67d27){return new BPromise(function(_0x5c185b,_0x29489e){return client[_0x577e('0xb')](_0x2834b5,_0xa67d27)[_0x577e('0xc')](function(_0x4e70d7){logger[_0x577e('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1da321,_0x577e('0xe'));logger[_0x577e('0xf')](_0x577e('0x10'),_0x1da321,'request\x20sent',JSON['stringify'](_0x4e70d7));if(_0x4e70d7['error']){if(_0x4e70d7[_0x577e('0x11')]['code']===0x1f4){logger[_0x577e('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1da321,_0x4e70d7[_0x577e('0x11')][_0x577e('0x12')]);return _0x29489e(_0x4e70d7[_0x577e('0x11')][_0x577e('0x12')]);}logger[_0x577e('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1da321,_0x4e70d7[_0x577e('0x11')][_0x577e('0x12')]);return _0x5c185b(_0x4e70d7['error'][_0x577e('0x12')]);}else{logger[_0x577e('0xd')](_0x577e('0x13'),_0x1da321,_0x577e('0xe'));_0x5c185b(_0x4e70d7['result'][_0x577e('0x12')]);}})['catch'](function(_0x99321d){logger[_0x577e('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1da321,_0x99321d);_0x29489e(_0x99321d);});});}