Built motion from commit b5996064.|2.6.21
[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 _0x7050=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s'];(function(_0x22ddc1,_0x574e26){var _0x3165b1=function(_0xea3874){while(--_0xea3874){_0x22ddc1['push'](_0x22ddc1['shift']());}};_0x3165b1(++_0x574e26);}(_0x7050,0xa9));var _0x0705=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7050[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0x0705('0x0'));var moment=require(_0x0705('0x1'));var BPromise=require(_0x0705('0x2'));var rs=require(_0x0705('0x3'));var fs=require('fs');var Redis=require(_0x0705('0x4'));var db=require(_0x0705('0x5'))['db'];var utils=require(_0x0705('0x6'));var logger=require(_0x0705('0x7'))(_0x0705('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0705('0x9')][_0x0705('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x847757,_0x33f700,_0xcac42f){return new BPromise(function(_0x3a57ff,_0x111db3){return client[_0x0705('0xb')](_0x847757,_0xcac42f)[_0x0705('0xc')](function(_0x2ea251){logger[_0x0705('0xd')](_0x0705('0xe'),_0x33f700,_0x0705('0xf'));logger[_0x0705('0x10')](_0x0705('0x11'),_0x33f700,_0x0705('0xf'),JSON[_0x0705('0x12')](_0x2ea251));if(_0x2ea251[_0x0705('0x13')]){if(_0x2ea251[_0x0705('0x13')][_0x0705('0x14')]===0x1f4){logger[_0x0705('0x13')](_0x0705('0xe'),_0x33f700,_0x2ea251[_0x0705('0x13')][_0x0705('0x15')]);return _0x111db3(_0x2ea251['error']['message']);}logger[_0x0705('0x13')](_0x0705('0xe'),_0x33f700,_0x2ea251[_0x0705('0x13')][_0x0705('0x15')]);return _0x3a57ff(_0x2ea251[_0x0705('0x13')]['message']);}else{logger[_0x0705('0xd')](_0x0705('0xe'),_0x33f700,_0x0705('0xf'));_0x3a57ff(_0x2ea251['result'][_0x0705('0x15')]);}})[_0x0705('0x16')](function(_0xe43637){logger['error'](_0x0705('0xe'),_0x33f700,_0xe43637);_0x111db3(_0xe43637);});});}