Built motion from commit 3c2ce842.|2.6.31
[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 _0x8af4=['error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x8af4,0x74));var _0x48af=function(_0x57d3d9,_0x2d605b){_0x57d3d9=_0x57d3d9-0x0;var _0x46730c=_0x8af4[_0x57d3d9];return _0x46730c;};'use strict';var _=require(_0x48af('0x0'));var util=require(_0x48af('0x1'));var moment=require('moment');var BPromise=require(_0x48af('0x2'));var rs=require(_0x48af('0x3'));var fs=require('fs');var Redis=require(_0x48af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x48af('0x5'));var logger=require(_0x48af('0x6'))('rpc');var config=require(_0x48af('0x7'));var jayson=require(_0x48af('0x8'));var client=jayson[_0x48af('0x9')][_0x48af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31e95e,_0x54bbae,_0x34a9a9){return new BPromise(function(_0x298bca,_0x166667){return client[_0x48af('0xb')](_0x31e95e,_0x34a9a9)[_0x48af('0xc')](function(_0x97cba1){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x54bbae,_0x48af('0xd'));logger[_0x48af('0xe')](_0x48af('0xf'),_0x54bbae,_0x48af('0xd'),JSON['stringify'](_0x97cba1));if(_0x97cba1[_0x48af('0x10')]){if(_0x97cba1[_0x48af('0x10')][_0x48af('0x11')]===0x1f4){logger[_0x48af('0x10')](_0x48af('0x12'),_0x54bbae,_0x97cba1[_0x48af('0x10')][_0x48af('0x13')]);return _0x166667(_0x97cba1['error']['message']);}logger[_0x48af('0x10')](_0x48af('0x12'),_0x54bbae,_0x97cba1[_0x48af('0x10')][_0x48af('0x13')]);return _0x298bca(_0x97cba1[_0x48af('0x10')][_0x48af('0x13')]);}else{logger['info'](_0x48af('0x12'),_0x54bbae,_0x48af('0xd'));_0x298bca(_0x97cba1[_0x48af('0x14')][_0x48af('0x13')]);}})[_0x48af('0x15')](function(_0x6f206){logger[_0x48af('0x10')](_0x48af('0x12'),_0x54bbae,_0x6f206);_0x166667(_0x6f206);});});}