Built motion from commit 43538d75.|2.5.35
[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 _0xa24a=['Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info'];(function(_0x407beb,_0x41c052){var _0x267fe1=function(_0x27647f){while(--_0x27647f){_0x407beb['push'](_0x407beb['shift']());}};_0x267fe1(++_0x41c052);}(_0xa24a,0xf0));var _0xaa24=function(_0x21a933,_0x45b4ec){_0x21a933=_0x21a933-0x0;var _0x1e81f2=_0xa24a[_0x21a933];return _0x1e81f2;};'use strict';var _=require(_0xaa24('0x0'));var util=require(_0xaa24('0x1'));var moment=require('moment');var BPromise=require(_0xaa24('0x2'));var rs=require(_0xaa24('0x3'));var fs=require('fs');var Redis=require(_0xaa24('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa24('0x5'));var logger=require(_0xaa24('0x6'))(_0xaa24('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa24('0x8'));var client=jayson[_0xaa24('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x89c7d6,_0x2fcf0b,_0x59e92b){return new BPromise(function(_0x3cefdc,_0x42c2d6){return client['request'](_0x89c7d6,_0x59e92b)[_0xaa24('0xa')](function(_0x572feb){logger[_0xaa24('0xb')](_0xaa24('0xc'),_0x2fcf0b,_0xaa24('0xd'));logger[_0xaa24('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x2fcf0b,_0xaa24('0xd'),JSON['stringify'](_0x572feb));if(_0x572feb['error']){if(_0x572feb[_0xaa24('0xf')]['code']===0x1f4){logger[_0xaa24('0xf')](_0xaa24('0xc'),_0x2fcf0b,_0x572feb[_0xaa24('0xf')]['message']);return _0x42c2d6(_0x572feb['error'][_0xaa24('0x10')]);}logger[_0xaa24('0xf')]('Dynamics365Field,\x20%s,\x20%s',_0x2fcf0b,_0x572feb[_0xaa24('0xf')][_0xaa24('0x10')]);return _0x3cefdc(_0x572feb[_0xaa24('0xf')][_0xaa24('0x10')]);}else{logger[_0xaa24('0xb')](_0xaa24('0xc'),_0x2fcf0b,'request\x20sent');_0x3cefdc(_0x572feb[_0xaa24('0x11')][_0xaa24('0x10')]);}})['catch'](function(_0x3fba8e){logger[_0xaa24('0xf')](_0xaa24('0xc'),_0x2fcf0b,_0x3fba8e);_0x42c2d6(_0x3fba8e);});});}