Built motion from commit 775e2a94.|2.6.3
[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 _0x38a3=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x35f4f3,_0x437876){var _0x5e9941=function(_0x15ed37){while(--_0x15ed37){_0x35f4f3['push'](_0x35f4f3['shift']());}};_0x5e9941(++_0x437876);}(_0x38a3,0x7c));var _0x338a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x38a3[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x338a('0x0'));var util=require(_0x338a('0x1'));var moment=require('moment');var BPromise=require(_0x338a('0x2'));var rs=require(_0x338a('0x3'));var fs=require('fs');var Redis=require(_0x338a('0x4'));var db=require(_0x338a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x338a('0x6'));var config=require(_0x338a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x338a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37aebd,_0x5b5f7f,_0x1a9edc){return new BPromise(function(_0x779496,_0x151e49){return client[_0x338a('0x9')](_0x37aebd,_0x1a9edc)[_0x338a('0xa')](function(_0x17bd62){logger[_0x338a('0xb')](_0x338a('0xc'),_0x5b5f7f,_0x338a('0xd'));logger[_0x338a('0xe')](_0x338a('0xf'),_0x5b5f7f,_0x338a('0xd'),JSON[_0x338a('0x10')](_0x17bd62));if(_0x17bd62[_0x338a('0x11')]){if(_0x17bd62['error'][_0x338a('0x12')]===0x1f4){logger[_0x338a('0x11')](_0x338a('0xc'),_0x5b5f7f,_0x17bd62[_0x338a('0x11')]['message']);return _0x151e49(_0x17bd62[_0x338a('0x11')]['message']);}logger[_0x338a('0x11')](_0x338a('0xc'),_0x5b5f7f,_0x17bd62['error'][_0x338a('0x13')]);return _0x779496(_0x17bd62[_0x338a('0x11')][_0x338a('0x13')]);}else{logger[_0x338a('0xb')](_0x338a('0xc'),_0x5b5f7f,_0x338a('0xd'));_0x779496(_0x17bd62[_0x338a('0x14')][_0x338a('0x13')]);}})['catch'](function(_0x9f8c1c){logger[_0x338a('0x11')](_0x338a('0xc'),_0x5b5f7f,_0x9f8c1c);_0x151e49(_0x9f8c1c);});});}