Built motion from commit 9d1906d1.|2.5.40
[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 _0x5120=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','client','http','request'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0x5120,0xaa));var _0x0512=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x5120[_0x491faa];return _0x414440;};'use strict';var _=require(_0x0512('0x0'));var util=require(_0x0512('0x1'));var moment=require(_0x0512('0x2'));var BPromise=require(_0x0512('0x3'));var rs=require(_0x0512('0x4'));var fs=require('fs');var Redis=require(_0x0512('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0512('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0512('0x7')][_0x0512('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51fd89,_0x609978,_0x4ac3af){return new BPromise(function(_0x305b70,_0x2d757b){return client[_0x0512('0x9')](_0x51fd89,_0x4ac3af)[_0x0512('0xa')](function(_0x2fea67){logger[_0x0512('0xb')](_0x0512('0xc'),_0x609978,_0x0512('0xd'));logger[_0x0512('0xe')](_0x0512('0xf'),_0x609978,_0x0512('0xd'),JSON[_0x0512('0x10')](_0x2fea67));if(_0x2fea67[_0x0512('0x11')]){if(_0x2fea67[_0x0512('0x11')][_0x0512('0x12')]===0x1f4){logger[_0x0512('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x609978,_0x2fea67['error'][_0x0512('0x13')]);return _0x2d757b(_0x2fea67[_0x0512('0x11')]['message']);}logger[_0x0512('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x609978,_0x2fea67['error'][_0x0512('0x13')]);return _0x305b70(_0x2fea67[_0x0512('0x11')]['message']);}else{logger[_0x0512('0xb')](_0x0512('0xc'),_0x609978,_0x0512('0xd'));_0x305b70(_0x2fea67['result'][_0x0512('0x13')]);}})['catch'](function(_0x291dda){logger[_0x0512('0x11')](_0x0512('0xc'),_0x609978,_0x291dda);_0x2d757b(_0x291dda);});});}