Built motion from commit 3e059bc2.|2.5.32
[motion2.git] / server / api / intDynamics365Field / intDynamics365Field.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 _0xfe07=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x38b7db,_0x393b2b){var _0x471c14=function(_0x53ae9e){while(--_0x53ae9e){_0x38b7db['push'](_0x38b7db['shift']());}};_0x471c14(++_0x393b2b);}(_0xfe07,0xa2));var _0x7fe0=function(_0x3a8845,_0x1ff090){_0x3a8845=_0x3a8845-0x0;var _0x810878=_0xfe07[_0x3a8845];return _0x810878;};'use strict';var _=require(_0x7fe0('0x0'));var util=require(_0x7fe0('0x1'));var moment=require(_0x7fe0('0x2'));var BPromise=require(_0x7fe0('0x3'));var rs=require(_0x7fe0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7fe0('0x5'));var logger=require(_0x7fe0('0x6'))(_0x7fe0('0x7'));var config=require(_0x7fe0('0x8'));var jayson=require(_0x7fe0('0x9'));var client=jayson[_0x7fe0('0xa')][_0x7fe0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55036b,_0x50309f,_0x4619d5){return new BPromise(function(_0x43c452,_0x40bf72){return client[_0x7fe0('0xc')](_0x55036b,_0x4619d5)['then'](function(_0x499747){logger[_0x7fe0('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x50309f,_0x7fe0('0xe'));logger[_0x7fe0('0xf')](_0x7fe0('0x10'),_0x50309f,_0x7fe0('0xe'),JSON[_0x7fe0('0x11')](_0x499747));if(_0x499747[_0x7fe0('0x12')]){if(_0x499747[_0x7fe0('0x12')][_0x7fe0('0x13')]===0x1f4){logger[_0x7fe0('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x50309f,_0x499747[_0x7fe0('0x12')][_0x7fe0('0x14')]);return _0x40bf72(_0x499747[_0x7fe0('0x12')][_0x7fe0('0x14')]);}logger[_0x7fe0('0x12')](_0x7fe0('0x15'),_0x50309f,_0x499747[_0x7fe0('0x12')][_0x7fe0('0x14')]);return _0x43c452(_0x499747[_0x7fe0('0x12')]['message']);}else{logger[_0x7fe0('0xd')](_0x7fe0('0x15'),_0x50309f,'request\x20sent');_0x43c452(_0x499747[_0x7fe0('0x16')][_0x7fe0('0x14')]);}})[_0x7fe0('0x17')](function(_0x34aee2){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x50309f,_0x34aee2);_0x40bf72(_0x34aee2);});});}