Built motion from commit 896e83a8.|2.6.30
[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 _0xed93=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment'];(function(_0x467946,_0x58d051){var _0x5be916=function(_0x163b83){while(--_0x163b83){_0x467946['push'](_0x467946['shift']());}};_0x5be916(++_0x58d051);}(_0xed93,0x1cc));var _0x3ed9=function(_0x260eb3,_0xe8c2b){_0x260eb3=_0x260eb3-0x0;var _0x283366=_0xed93[_0x260eb3];return _0x283366;};'use strict';var _=require('lodash');var util=require(_0x3ed9('0x0'));var moment=require(_0x3ed9('0x1'));var BPromise=require(_0x3ed9('0x2'));var rs=require(_0x3ed9('0x3'));var fs=require('fs');var Redis=require(_0x3ed9('0x4'));var db=require(_0x3ed9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed9('0x6'))(_0x3ed9('0x7'));var config=require(_0x3ed9('0x8'));var jayson=require(_0x3ed9('0x9'));var client=jayson[_0x3ed9('0xa')][_0x3ed9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2aac77,_0x124923,_0x1569c1){return new BPromise(function(_0x3b992b,_0x33a222){return client[_0x3ed9('0xc')](_0x2aac77,_0x1569c1)[_0x3ed9('0xd')](function(_0x17885a){logger[_0x3ed9('0xe')](_0x3ed9('0xf'),_0x124923,_0x3ed9('0x10'));logger[_0x3ed9('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x124923,'request\x20sent',JSON['stringify'](_0x17885a));if(_0x17885a['error']){if(_0x17885a['error']['code']===0x1f4){logger[_0x3ed9('0x12')](_0x3ed9('0xf'),_0x124923,_0x17885a['error']['message']);return _0x33a222(_0x17885a[_0x3ed9('0x12')][_0x3ed9('0x13')]);}logger['error'](_0x3ed9('0xf'),_0x124923,_0x17885a[_0x3ed9('0x12')][_0x3ed9('0x13')]);return _0x3b992b(_0x17885a[_0x3ed9('0x12')][_0x3ed9('0x13')]);}else{logger['info'](_0x3ed9('0xf'),_0x124923,'request\x20sent');_0x3b992b(_0x17885a[_0x3ed9('0x14')][_0x3ed9('0x13')]);}})[_0x3ed9('0x15')](function(_0x14bffd){logger[_0x3ed9('0x12')](_0x3ed9('0xf'),_0x124923,_0x14bffd);_0x33a222(_0x14bffd);});});}