e30da318f596d1d9e91648f17b111581e66eb613
[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 _0xafc1=['jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xafc1,0x9e));var _0x1afc=function(_0x1dfd01,_0x4c3e0b){_0x1dfd01=_0x1dfd01-0x0;var _0x25e63c=_0xafc1[_0x1dfd01];return _0x25e63c;};'use strict';var _=require(_0x1afc('0x0'));var util=require(_0x1afc('0x1'));var moment=require(_0x1afc('0x2'));var BPromise=require(_0x1afc('0x3'));var rs=require(_0x1afc('0x4'));var fs=require('fs');var Redis=require(_0x1afc('0x5'));var db=require(_0x1afc('0x6'))['db'];var utils=require(_0x1afc('0x7'));var logger=require('../../config/logger')(_0x1afc('0x8'));var config=require(_0x1afc('0x9'));var jayson=require(_0x1afc('0xa'));var client=jayson[_0x1afc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bcf3d,_0x8dac69,_0x5567e9){return new BPromise(function(_0x354148,_0x4b4c8f){return client[_0x1afc('0xc')](_0x2bcf3d,_0x5567e9)[_0x1afc('0xd')](function(_0x12c8b4){logger[_0x1afc('0xe')](_0x1afc('0xf'),_0x8dac69,'request\x20sent');logger[_0x1afc('0x10')](_0x1afc('0x11'),_0x8dac69,_0x1afc('0x12'),JSON[_0x1afc('0x13')](_0x12c8b4));if(_0x12c8b4[_0x1afc('0x14')]){if(_0x12c8b4[_0x1afc('0x14')]['code']===0x1f4){logger[_0x1afc('0x14')](_0x1afc('0xf'),_0x8dac69,_0x12c8b4[_0x1afc('0x14')]['message']);return _0x4b4c8f(_0x12c8b4[_0x1afc('0x14')]['message']);}logger[_0x1afc('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x8dac69,_0x12c8b4[_0x1afc('0x14')][_0x1afc('0x15')]);return _0x354148(_0x12c8b4[_0x1afc('0x14')][_0x1afc('0x15')]);}else{logger['info'](_0x1afc('0xf'),_0x8dac69,_0x1afc('0x12'));_0x354148(_0x12c8b4[_0x1afc('0x16')]['message']);}})[_0x1afc('0x17')](function(_0xef1b96){logger[_0x1afc('0x14')](_0x1afc('0xf'),_0x8dac69,_0xef1b96);_0x4b4c8f(_0xef1b96);});});}