9281e8a6a970d4f604a63bcfacf38bea7bf90eda
[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 _0x7e73=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0x7e73,0xe2));var _0x37e7=function(_0xf0a6fe,_0x36ecc1){_0xf0a6fe=_0xf0a6fe-0x0;var _0x50af28=_0x7e73[_0xf0a6fe];return _0x50af28;};'use strict';var _=require(_0x37e7('0x0'));var util=require(_0x37e7('0x1'));var moment=require('moment');var BPromise=require(_0x37e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37e7('0x3'));var db=require(_0x37e7('0x4'))['db'];var utils=require(_0x37e7('0x5'));var logger=require(_0x37e7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x37e7('0x7'));var client=jayson[_0x37e7('0x8')][_0x37e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23004a,_0x8346ba,_0x2e232a){return new BPromise(function(_0x2e1780,_0x3a8481){return client[_0x37e7('0xa')](_0x23004a,_0x2e232a)[_0x37e7('0xb')](function(_0x19d661){logger['info'](_0x37e7('0xc'),_0x8346ba,_0x37e7('0xd'));logger['debug'](_0x37e7('0xe'),_0x8346ba,'request\x20sent',JSON[_0x37e7('0xf')](_0x19d661));if(_0x19d661[_0x37e7('0x10')]){if(_0x19d661[_0x37e7('0x10')][_0x37e7('0x11')]===0x1f4){logger[_0x37e7('0x10')](_0x37e7('0xc'),_0x8346ba,_0x19d661[_0x37e7('0x10')][_0x37e7('0x12')]);return _0x3a8481(_0x19d661[_0x37e7('0x10')][_0x37e7('0x12')]);}logger[_0x37e7('0x10')](_0x37e7('0xc'),_0x8346ba,_0x19d661[_0x37e7('0x10')][_0x37e7('0x12')]);return _0x2e1780(_0x19d661[_0x37e7('0x10')][_0x37e7('0x12')]);}else{logger[_0x37e7('0x13')](_0x37e7('0xc'),_0x8346ba,_0x37e7('0xd'));_0x2e1780(_0x19d661[_0x37e7('0x14')][_0x37e7('0x12')]);}})['catch'](function(_0x3d1f22){logger['error'](_0x37e7('0xc'),_0x8346ba,_0x3d1f22);_0x3a8481(_0x3d1f22);});});}