Built motion from commit efa66e19.|2.6.22
[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 _0xd29d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x16255a,_0x5782ae){var _0x407788=function(_0x16ae42){while(--_0x16ae42){_0x16255a['push'](_0x16255a['shift']());}};_0x407788(++_0x5782ae);}(_0xd29d,0x124));var _0xdd29=function(_0x2e9443,_0x1bd92d){_0x2e9443=_0x2e9443-0x0;var _0x56851b=_0xd29d[_0x2e9443];return _0x56851b;};'use strict';var _=require('lodash');var util=require(_0xdd29('0x0'));var moment=require(_0xdd29('0x1'));var BPromise=require(_0xdd29('0x2'));var rs=require(_0xdd29('0x3'));var fs=require('fs');var Redis=require(_0xdd29('0x4'));var db=require(_0xdd29('0x5'))['db'];var utils=require(_0xdd29('0x6'));var logger=require(_0xdd29('0x7'))(_0xdd29('0x8'));var config=require(_0xdd29('0x9'));var jayson=require(_0xdd29('0xa'));var client=jayson[_0xdd29('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57dd44,_0x457e52,_0x5ca71c){return new BPromise(function(_0x461dc9,_0x3b225c){return client['request'](_0x57dd44,_0x5ca71c)[_0xdd29('0xc')](function(_0x50e842){logger[_0xdd29('0xd')](_0xdd29('0xe'),_0x457e52,_0xdd29('0xf'));logger[_0xdd29('0x10')](_0xdd29('0x11'),_0x457e52,_0xdd29('0xf'),JSON['stringify'](_0x50e842));if(_0x50e842[_0xdd29('0x12')]){if(_0x50e842['error'][_0xdd29('0x13')]===0x1f4){logger[_0xdd29('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x457e52,_0x50e842['error']['message']);return _0x3b225c(_0x50e842[_0xdd29('0x12')]['message']);}logger[_0xdd29('0x12')](_0xdd29('0xe'),_0x457e52,_0x50e842['error']['message']);return _0x461dc9(_0x50e842[_0xdd29('0x12')][_0xdd29('0x14')]);}else{logger[_0xdd29('0xd')](_0xdd29('0xe'),_0x457e52,_0xdd29('0xf'));_0x461dc9(_0x50e842[_0xdd29('0x15')][_0xdd29('0x14')]);}})[_0xdd29('0x16')](function(_0x4f2dc9){logger['error'](_0xdd29('0xe'),_0x457e52,_0x4f2dc9);_0x3b225c(_0x4f2dc9);});});}