Built motion from commit (unavailable).|2.5.16
[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 _0xcaaf=['client','http','request','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x45e959,_0x1cdbbc){var _0x468a52=function(_0x19ec40){while(--_0x19ec40){_0x45e959['push'](_0x45e959['shift']());}};_0x468a52(++_0x1cdbbc);}(_0xcaaf,0x66));var _0xfcaa=function(_0x2a445e,_0x3ce9e6){_0x2a445e=_0x2a445e-0x0;var _0x4a14bb=_0xcaaf[_0x2a445e];return _0x4a14bb;};'use strict';var _=require(_0xfcaa('0x0'));var util=require('util');var moment=require(_0xfcaa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcaa('0x2'));var db=require(_0xfcaa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfcaa('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcaa('0x5'));var client=jayson[_0xfcaa('0x6')][_0xfcaa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x28a6b6,_0x26678d,_0x287c48){return new BPromise(function(_0x15ef84,_0x4ee7d3){return client[_0xfcaa('0x8')](_0x28a6b6,_0x287c48)['then'](function(_0x30a4a0){logger['info'](_0xfcaa('0x9'),_0x26678d,'request\x20sent');logger['debug'](_0xfcaa('0xa'),_0x26678d,'request\x20sent',JSON[_0xfcaa('0xb')](_0x30a4a0));if(_0x30a4a0[_0xfcaa('0xc')]){if(_0x30a4a0[_0xfcaa('0xc')][_0xfcaa('0xd')]===0x1f4){logger[_0xfcaa('0xc')](_0xfcaa('0x9'),_0x26678d,_0x30a4a0[_0xfcaa('0xc')][_0xfcaa('0xe')]);return _0x4ee7d3(_0x30a4a0['error'][_0xfcaa('0xe')]);}logger[_0xfcaa('0xc')](_0xfcaa('0x9'),_0x26678d,_0x30a4a0[_0xfcaa('0xc')]['message']);return _0x15ef84(_0x30a4a0[_0xfcaa('0xc')][_0xfcaa('0xe')]);}else{logger[_0xfcaa('0xf')](_0xfcaa('0x9'),_0x26678d,'request\x20sent');_0x15ef84(_0x30a4a0[_0xfcaa('0x10')][_0xfcaa('0xe')]);}})[_0xfcaa('0x11')](function(_0x580335){logger[_0xfcaa('0xc')](_0xfcaa('0x9'),_0x26678d,_0x580335);_0x4ee7d3(_0x580335);});});}