Built motion from commit (unavailable).|2.5.13
[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 _0x5fc2=['request\x20sent','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info'];(function(_0x1d5d4f,_0x18f1f2){var _0x3896c1=function(_0x4dd67e){while(--_0x4dd67e){_0x1d5d4f['push'](_0x1d5d4f['shift']());}};_0x3896c1(++_0x18f1f2);}(_0x5fc2,0x1c8));var _0x25fc=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x5fc2[_0x1d426f];return _0x17f71a;};'use strict';var _=require(_0x25fc('0x0'));var util=require('util');var moment=require(_0x25fc('0x1'));var BPromise=require(_0x25fc('0x2'));var rs=require(_0x25fc('0x3'));var fs=require('fs');var Redis=require(_0x25fc('0x4'));var db=require(_0x25fc('0x5'))['db'];var utils=require(_0x25fc('0x6'));var logger=require(_0x25fc('0x7'))('rpc');var config=require(_0x25fc('0x8'));var jayson=require(_0x25fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49b83f,_0x5bbc64,_0x5cc597){return new BPromise(function(_0xc31dbd,_0x17e381){return client['request'](_0x49b83f,_0x5cc597)[_0x25fc('0xa')](function(_0x4d54d4){logger[_0x25fc('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5bbc64,_0x25fc('0xc'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5bbc64,'request\x20sent',JSON[_0x25fc('0xd')](_0x4d54d4));if(_0x4d54d4['error']){if(_0x4d54d4[_0x25fc('0xe')]['code']===0x1f4){logger[_0x25fc('0xe')](_0x25fc('0xf'),_0x5bbc64,_0x4d54d4[_0x25fc('0xe')][_0x25fc('0x10')]);return _0x17e381(_0x4d54d4[_0x25fc('0xe')][_0x25fc('0x10')]);}logger['error'](_0x25fc('0xf'),_0x5bbc64,_0x4d54d4[_0x25fc('0xe')]['message']);return _0xc31dbd(_0x4d54d4['error']['message']);}else{logger['info'](_0x25fc('0xf'),_0x5bbc64,_0x25fc('0xc'));_0xc31dbd(_0x4d54d4['result'][_0x25fc('0x10')]);}})[_0x25fc('0x11')](function(_0x4d4910){logger['error'](_0x25fc('0xf'),_0x5bbc64,_0x4d4910);_0x17e381(_0x4d4910);});});}