Built motion from commit a61a4a20.|2.5.46
[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 _0xe29d=['message','error','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xe29d,0x10c));var _0xde29=function(_0xfc1218,_0x5132f6){_0xfc1218=_0xfc1218-0x0;var _0x418075=_0xe29d[_0xfc1218];return _0x418075;};'use strict';var _=require(_0xde29('0x0'));var util=require(_0xde29('0x1'));var moment=require(_0xde29('0x2'));var BPromise=require(_0xde29('0x3'));var rs=require(_0xde29('0x4'));var fs=require('fs');var Redis=require(_0xde29('0x5'));var db=require(_0xde29('0x6'))['db'];var utils=require(_0xde29('0x7'));var logger=require(_0xde29('0x8'))(_0xde29('0x9'));var config=require(_0xde29('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2809a9,_0x33de41,_0x56bdcc){return new BPromise(function(_0x5467cb,_0x3a8b40){return client[_0xde29('0xb')](_0x2809a9,_0x56bdcc)[_0xde29('0xc')](function(_0x242557){logger[_0xde29('0xd')](_0xde29('0xe'),_0x33de41,_0xde29('0xf'));logger[_0xde29('0x10')](_0xde29('0x11'),_0x33de41,_0xde29('0xf'),JSON[_0xde29('0x12')](_0x242557));if(_0x242557['error']){if(_0x242557['error'][_0xde29('0x13')]===0x1f4){logger['error'](_0xde29('0xe'),_0x33de41,_0x242557['error'][_0xde29('0x14')]);return _0x3a8b40(_0x242557[_0xde29('0x15')][_0xde29('0x14')]);}logger[_0xde29('0x15')]('Dynamics365Field,\x20%s,\x20%s',_0x33de41,_0x242557['error'][_0xde29('0x14')]);return _0x5467cb(_0x242557[_0xde29('0x15')][_0xde29('0x14')]);}else{logger[_0xde29('0xd')](_0xde29('0xe'),_0x33de41,_0xde29('0xf'));_0x5467cb(_0x242557[_0xde29('0x16')][_0xde29('0x14')]);}})[_0xde29('0x17')](function(_0xb31d6){logger[_0xde29('0x15')](_0xde29('0xe'),_0x33de41,_0xb31d6);_0x3a8b40(_0xb31d6);});});}