Built motion from commit (unavailable).|2.5.2
[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 _0xcb2b=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5e8d6f,_0x357a70){var _0x3159c6=function(_0x2d2f85){while(--_0x2d2f85){_0x5e8d6f['push'](_0x5e8d6f['shift']());}};_0x3159c6(++_0x357a70);}(_0xcb2b,0x13e));var _0xbcb2=function(_0x333195,_0x366608){_0x333195=_0x333195-0x0;var _0x2e44de=_0xcb2b[_0x333195];return _0x2e44de;};'use strict';var _=require('lodash');var util=require(_0xbcb2('0x0'));var moment=require('moment');var BPromise=require(_0xbcb2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbcb2('0x2'));var db=require(_0xbcb2('0x3'))['db'];var utils=require(_0xbcb2('0x4'));var logger=require(_0xbcb2('0x5'))(_0xbcb2('0x6'));var config=require(_0xbcb2('0x7'));var jayson=require(_0xbcb2('0x8'));var client=jayson['client'][_0xbcb2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3077c7,_0x24b750,_0x55a44c){return new BPromise(function(_0x318578,_0x324e8d){return client[_0xbcb2('0xa')](_0x3077c7,_0x55a44c)[_0xbcb2('0xb')](function(_0x58813f){logger[_0xbcb2('0xc')](_0xbcb2('0xd'),_0x24b750,_0xbcb2('0xe'));logger[_0xbcb2('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x24b750,_0xbcb2('0xe'),JSON[_0xbcb2('0x10')](_0x58813f));if(_0x58813f[_0xbcb2('0x11')]){if(_0x58813f['error'][_0xbcb2('0x12')]===0x1f4){logger[_0xbcb2('0x11')](_0xbcb2('0xd'),_0x24b750,_0x58813f[_0xbcb2('0x11')][_0xbcb2('0x13')]);return _0x324e8d(_0x58813f[_0xbcb2('0x11')]['message']);}logger[_0xbcb2('0x11')](_0xbcb2('0xd'),_0x24b750,_0x58813f[_0xbcb2('0x11')][_0xbcb2('0x13')]);return _0x318578(_0x58813f[_0xbcb2('0x11')][_0xbcb2('0x13')]);}else{logger['info'](_0xbcb2('0xd'),_0x24b750,'request\x20sent');_0x318578(_0x58813f[_0xbcb2('0x14')][_0xbcb2('0x13')]);}})[_0xbcb2('0x15')](function(_0x4f424b){logger[_0xbcb2('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x24b750,_0x4f424b);_0x324e8d(_0x4f424b);});});}