Built motion from commit 192134f6.|2.6.25
[motion2.git] / server / api / intServicenowConfiguration / intServicenowConfiguration.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 _0x8adb=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x58c0f6,_0x32717a){var _0x4f11bf=function(_0x18dce5){while(--_0x18dce5){_0x58c0f6['push'](_0x58c0f6['shift']());}};_0x4f11bf(++_0x32717a);}(_0x8adb,0x105));var _0xb8ad=function(_0x10fa32,_0x3a59c4){_0x10fa32=_0x10fa32-0x0;var _0x423e7f=_0x8adb[_0x10fa32];return _0x423e7f;};'use strict';var _=require(_0xb8ad('0x0'));var util=require(_0xb8ad('0x1'));var moment=require('moment');var BPromise=require(_0xb8ad('0x2'));var rs=require(_0xb8ad('0x3'));var fs=require('fs');var Redis=require(_0xb8ad('0x4'));var db=require(_0xb8ad('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8ad('0x6'))(_0xb8ad('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb8ad('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e4541,_0x5e3934,_0x53a961){return new BPromise(function(_0x14dd77,_0x48f0a2){return client[_0xb8ad('0x9')](_0x3e4541,_0x53a961)['then'](function(_0x1a95aa){logger[_0xb8ad('0xa')](_0xb8ad('0xb'),_0x5e3934,_0xb8ad('0xc'));logger[_0xb8ad('0xd')](_0xb8ad('0xe'),_0x5e3934,_0xb8ad('0xc'),JSON['stringify'](_0x1a95aa));if(_0x1a95aa[_0xb8ad('0xf')]){if(_0x1a95aa['error'][_0xb8ad('0x10')]===0x1f4){logger[_0xb8ad('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e3934,_0x1a95aa[_0xb8ad('0xf')][_0xb8ad('0x11')]);return _0x48f0a2(_0x1a95aa[_0xb8ad('0xf')]['message']);}logger[_0xb8ad('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5e3934,_0x1a95aa[_0xb8ad('0xf')]['message']);return _0x14dd77(_0x1a95aa[_0xb8ad('0xf')][_0xb8ad('0x11')]);}else{logger[_0xb8ad('0xa')](_0xb8ad('0xb'),_0x5e3934,_0xb8ad('0xc'));_0x14dd77(_0x1a95aa[_0xb8ad('0x12')][_0xb8ad('0x11')]);}})[_0xb8ad('0x13')](function(_0x229237){logger['error'](_0xb8ad('0xb'),_0x5e3934,_0x229237);_0x48f0a2(_0x229237);});});}