Built motion from commit 5b761a7b.|2.5.36
[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 _0xc6fc=['code','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2e8a82,_0x151a2a){var _0xf088a2=function(_0x34af7a){while(--_0x34af7a){_0x2e8a82['push'](_0x2e8a82['shift']());}};_0xf088a2(++_0x151a2a);}(_0xc6fc,0x82));var _0xcc6f=function(_0x26c112,_0x41e2fd){_0x26c112=_0x26c112-0x0;var _0x4933d8=_0xc6fc[_0x26c112];return _0x4933d8;};'use strict';var _=require('lodash');var util=require(_0xcc6f('0x0'));var moment=require(_0xcc6f('0x1'));var BPromise=require(_0xcc6f('0x2'));var rs=require(_0xcc6f('0x3'));var fs=require('fs');var Redis=require(_0xcc6f('0x4'));var db=require(_0xcc6f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc6f('0x6'))(_0xcc6f('0x7'));var config=require(_0xcc6f('0x8'));var jayson=require(_0xcc6f('0x9'));var client=jayson[_0xcc6f('0xa')][_0xcc6f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3381d8,_0x3120b4,_0x10c3c8){return new BPromise(function(_0x151411,_0x3c4ba9){return client[_0xcc6f('0xc')](_0x3381d8,_0x10c3c8)[_0xcc6f('0xd')](function(_0x477596){logger[_0xcc6f('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3120b4,'request\x20sent');logger[_0xcc6f('0xf')](_0xcc6f('0x10'),_0x3120b4,_0xcc6f('0x11'),JSON[_0xcc6f('0x12')](_0x477596));if(_0x477596[_0xcc6f('0x13')]){if(_0x477596[_0xcc6f('0x13')][_0xcc6f('0x14')]===0x1f4){logger[_0xcc6f('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3120b4,_0x477596[_0xcc6f('0x13')]['message']);return _0x3c4ba9(_0x477596[_0xcc6f('0x13')][_0xcc6f('0x15')]);}logger[_0xcc6f('0x13')](_0xcc6f('0x16'),_0x3120b4,_0x477596['error'][_0xcc6f('0x15')]);return _0x151411(_0x477596[_0xcc6f('0x13')]['message']);}else{logger[_0xcc6f('0xe')](_0xcc6f('0x16'),_0x3120b4,_0xcc6f('0x11'));_0x151411(_0x477596[_0xcc6f('0x17')][_0xcc6f('0x15')]);}})[_0xcc6f('0x18')](function(_0x2349ab){logger[_0xcc6f('0x13')](_0xcc6f('0x16'),_0x3120b4,_0x2349ab);_0x3c4ba9(_0x2349ab);});});}