Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / intDynamics365Configuration / intDynamics365Configuration.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 _0xa601=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','lodash'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0xa601,0x1f3));var _0x1a60=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xa601[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x1a60('0x0'));var util=require('util');var moment=require(_0x1a60('0x1'));var BPromise=require(_0x1a60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a60('0x3'));var db=require(_0x1a60('0x4'))['db'];var utils=require(_0x1a60('0x5'));var logger=require('../../config/logger')(_0x1a60('0x6'));var config=require(_0x1a60('0x7'));var jayson=require(_0x1a60('0x8'));var client=jayson[_0x1a60('0x9')][_0x1a60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29df54,_0x4c47fb,_0x39098c){return new BPromise(function(_0x580449,_0x4da645){return client[_0x1a60('0xb')](_0x29df54,_0x39098c)['then'](function(_0x3573d0){logger[_0x1a60('0xc')](_0x1a60('0xd'),_0x4c47fb,_0x1a60('0xe'));logger[_0x1a60('0xf')](_0x1a60('0x10'),_0x4c47fb,'request\x20sent',JSON['stringify'](_0x3573d0));if(_0x3573d0[_0x1a60('0x11')]){if(_0x3573d0[_0x1a60('0x11')]['code']===0x1f4){logger[_0x1a60('0x11')](_0x1a60('0xd'),_0x4c47fb,_0x3573d0[_0x1a60('0x11')]['message']);return _0x4da645(_0x3573d0[_0x1a60('0x11')]['message']);}logger['error'](_0x1a60('0xd'),_0x4c47fb,_0x3573d0[_0x1a60('0x11')][_0x1a60('0x12')]);return _0x580449(_0x3573d0[_0x1a60('0x11')][_0x1a60('0x12')]);}else{logger['info'](_0x1a60('0xd'),_0x4c47fb,_0x1a60('0xe'));_0x580449(_0x3573d0[_0x1a60('0x13')]['message']);}})['catch'](function(_0x218e3c){logger[_0x1a60('0x11')](_0x1a60('0xd'),_0x4c47fb,_0x218e3c);_0x4da645(_0x218e3c);});});}