Built motion from commit 936e8062.|2.5.33
[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 _0x256d=['request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x256d,0x9c));var _0xd256=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x256d[_0x4c8a8f];return _0x404500;};'use strict';var _=require('lodash');var util=require(_0xd256('0x0'));var moment=require(_0xd256('0x1'));var BPromise=require(_0xd256('0x2'));var rs=require(_0xd256('0x3'));var fs=require('fs');var Redis=require(_0xd256('0x4'));var db=require(_0xd256('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd256('0x6'))(_0xd256('0x7'));var config=require(_0xd256('0x8'));var jayson=require(_0xd256('0x9'));var client=jayson[_0xd256('0xa')][_0xd256('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf12edc,_0xb112c4,_0x2f71da){return new BPromise(function(_0x28c76d,_0xa0be39){return client[_0xd256('0xc')](_0xf12edc,_0x2f71da)['then'](function(_0x553448){logger[_0xd256('0xd')](_0xd256('0xe'),_0xb112c4,_0xd256('0xf'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0xb112c4,'request\x20sent',JSON[_0xd256('0x10')](_0x553448));if(_0x553448[_0xd256('0x11')]){if(_0x553448['error'][_0xd256('0x12')]===0x1f4){logger[_0xd256('0x11')](_0xd256('0xe'),_0xb112c4,_0x553448[_0xd256('0x11')]['message']);return _0xa0be39(_0x553448[_0xd256('0x11')][_0xd256('0x13')]);}logger[_0xd256('0x11')](_0xd256('0xe'),_0xb112c4,_0x553448[_0xd256('0x11')][_0xd256('0x13')]);return _0x28c76d(_0x553448[_0xd256('0x11')][_0xd256('0x13')]);}else{logger['info'](_0xd256('0xe'),_0xb112c4,_0xd256('0xf'));_0x28c76d(_0x553448['result'][_0xd256('0x13')]);}})[_0xd256('0x14')](function(_0x3d8f73){logger[_0xd256('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xb112c4,_0x3d8f73);_0xa0be39(_0x3d8f73);});});}