0d3a3f5d8ab77d68ced984bb8984a21cd263c77f
[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 _0xea42=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug'];(function(_0x4f8909,_0x127885){var _0x8b66ef=function(_0x3b4891){while(--_0x3b4891){_0x4f8909['push'](_0x4f8909['shift']());}};_0x8b66ef(++_0x127885);}(_0xea42,0x81));var _0x2ea4=function(_0x300a2f,_0x54bb3c){_0x300a2f=_0x300a2f-0x0;var _0x5ee082=_0xea42[_0x300a2f];return _0x5ee082;};'use strict';var _=require(_0x2ea4('0x0'));var util=require(_0x2ea4('0x1'));var moment=require(_0x2ea4('0x2'));var BPromise=require(_0x2ea4('0x3'));var rs=require(_0x2ea4('0x4'));var fs=require('fs');var Redis=require(_0x2ea4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2ea4('0x6'))(_0x2ea4('0x7'));var config=require(_0x2ea4('0x8'));var jayson=require(_0x2ea4('0x9'));var client=jayson[_0x2ea4('0xa')][_0x2ea4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39276b,_0x1cff7c,_0xf66f90){return new BPromise(function(_0x44668e,_0x473f15){return client[_0x2ea4('0xc')](_0x39276b,_0xf66f90)[_0x2ea4('0xd')](function(_0x12627d){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x1cff7c,'request\x20sent');logger[_0x2ea4('0xe')](_0x2ea4('0xf'),_0x1cff7c,_0x2ea4('0x10'),JSON[_0x2ea4('0x11')](_0x12627d));if(_0x12627d[_0x2ea4('0x12')]){if(_0x12627d['error'][_0x2ea4('0x13')]===0x1f4){logger[_0x2ea4('0x12')](_0x2ea4('0x14'),_0x1cff7c,_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);return _0x473f15(_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);}logger['error'](_0x2ea4('0x14'),_0x1cff7c,_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);return _0x44668e(_0x12627d[_0x2ea4('0x12')][_0x2ea4('0x15')]);}else{logger[_0x2ea4('0x16')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1cff7c,_0x2ea4('0x10'));_0x44668e(_0x12627d[_0x2ea4('0x17')]['message']);}})['catch'](function(_0x1ffead){logger[_0x2ea4('0x12')](_0x2ea4('0x14'),_0x1cff7c,_0x1ffead);_0x473f15(_0x1ffead);});});}