Removing lint and strict typecheck

pull/1162/head
ShahanaFarooqui 1 year ago
parent 541b1cfa3c
commit d29a1fbdb8

@ -1,4 +1,4 @@
import * as WebSocket from 'ws';
import WebSocket from 'ws';
import { Logger } from '../../utils/logger.js';
import { Common } from '../../utils/common.js';
import { WSServer } from '../../utils/webSocketServer.js';

@ -76,12 +76,12 @@ export const authenticateUser = (req, res, next) => {
const password = req.body.authenticationValue;
if (common.rtl_pass === password && failed.count < ALLOWED_LOGIN_ATTEMPTS) {
if (req.body.twoFAToken && req.body.twoFAToken !== '') {
// if (!verifyToken(req.body.twoFAToken)) {
// logger.log({ selectedNode: req.session.selectedNode, level: 'ERROR', fileName: 'Authenticate', msg: 'Invalid Token! Failed IP ' + reqIP, error: { error: 'Invalid token.' } });
// failed.count = failed.count + 1;
// failed.lastTried = currentTime;
// return res.status(401).json(handleMultipleFailedAttemptsError(failed, currentTime, 'Invalid 2FA Token!'));
// }
if (!verifyToken(req.body.twoFAToken)) {
logger.log({ selectedNode: req.session.selectedNode, level: 'ERROR', fileName: 'Authenticate', msg: 'Invalid Token! Failed IP ' + reqIP, error: { error: 'Invalid token.' } });
failed.count = failed.count + 1;
failed.lastTried = currentTime;
return res.status(401).json(handleMultipleFailedAttemptsError(failed, currentTime, 'Invalid 2FA Token!'));
}
}
if (!req.session.selectedNode) {
req.session.selectedNode = common.initSelectedNode;

@ -9,7 +9,7 @@ export const getPageSettings = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Page Settings', msg: 'Getting Page Settings..' });
databaseService.find(req.session.selectedNode, CollectionsEnum.PAGE_SETTINGS).then((settings) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Page Settings', msg: 'Page Settings Received', data: settings });
return res.status(200).json(settings);
res.status(200).json(settings);
}).catch((errRes) => {
const err = common.handleError(errRes, 'Page Settings', 'Page Settings Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getBalance } from '../../controllers/cln/balance.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listChannels, openChannel, setChannelFee, closeChannel, getLocalRemoteBalance, listForwards, funderUpdatePolicy, listForwardsPaginated } from '../../controllers/cln/channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getFees } from '../../controllers/cln/fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo } from '../../controllers/cln/getInfo.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import infoCLRoutes from './getInfo.js';
import feesCLRoutes from './fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listInvoices, addInvoice, deleteExpiredInvoice } from '../../controllers/cln/invoices.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getRoute, listNode, listChannel, feeRates, listNodes } from '../../controllers/cln/network.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listOfferBookmarks, deleteOfferBookmark, listOffers, disableOffer, createOffer, fetchOfferInvoice } from '../../controllers/cln/offers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNewAddress, onChainWithdraw, getUTXOs } from '../../controllers/cln/onchain.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listPayments, postPayment } from '../../controllers/cln/payments.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPeers, postPeer, deletePeer } from '../../controllers/cln/peers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { decodePayments, decodePayment, signMessage, verifyMessage, listConfigs } from '../../controllers/cln/utility.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getChannels, getChannelStats, openChannel, updateChannelRelayFee, closeChannel } from '../../controllers/eclair/channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getFees, getPayments } from '../../controllers/eclair/fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo } from '../../controllers/eclair/getInfo.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import infoECLRoutes from './getInfo.js';
import feesECLRoutes from './fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listInvoices, getInvoice, createInvoice } from '../../controllers/eclair/invoices.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNodes } from '../../controllers/eclair/network.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNewAddress, getBalance, getTransactions, sendFunds } from '../../controllers/eclair/onchain.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { queryPaymentRoute, decodePayment, getSentPaymentsInformation, postPayment } from '../../controllers/eclair/payments.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPeers, connectPeer, deletePeer } from '../../controllers/eclair/peers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getBlockchainBalance } from '../../controllers/lnd/balance.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getAllChannels, getPendingChannels, getClosedChannels, postChannel, postTransactions, closeChannel, postChanPolicy } from '../../controllers/lnd/channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getBackup, getRestoreList, postBackupVerify, postRestore } from '../../controllers/lnd/channelsBackup.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getFees } from '../../controllers/lnd/fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo } from '../../controllers/lnd/getInfo.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getDescribeGraph, getGraphInfo, getAliasesForPubkeys, getGraphNode, getGraphEdge, getRemoteFeePolicy, getQueryRoutes } from '../../controllers/lnd/graph.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import infoRoutes from './getInfo.js';
import channelsRoutes from './channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listInvoices, invoiceLookup, addInvoice } from '../../controllers/lnd/invoices.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { signMessage, verifyMessage } from '../../controllers/lnd/message.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNewAddress } from '../../controllers/lnd/newAddress.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { decodePayment, decodePayments, getPayments, getAllLightningTransactions, paymentLookup } from '../../controllers/lnd/payments.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPeers, postPeer, deletePeer } from '../../controllers/lnd/peers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { forwardingHistory } from '../../controllers/lnd/switch.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getTransactions, postTransactions } from '../../controllers/lnd/transactions.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { genSeed, updateSelNodeOptions, getUTXOs, operateWallet, bumpFee, labelTransaction, leaseUTXO, releaseUTXO } from '../../controllers/lnd/wallet.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getRTLConfigInitial, getRTLConfig, updateUISettings, update2FASettings, getConfig, getFile, updateSelectedNode, updateDefaultNode, updateServiceSettings, updateSSO, getCurrencyRates } from '../../controllers/shared/RTLConf.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { authenticateUser, verifyToken, resetPassword, logoutUser } from '../../controllers/shared/authenticate.js';
const router = Router();

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo, getServiceInfo, listSwaps, getSwapInfo, createSwap, createReverseSwap, createChannel, deposit } from '../../controllers/shared/boltz.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import authenticateRoutes from './authenticate.js';
import boltzRoutes from './boltz.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { loopInTerms, loopInQuote, loopInTermsAndQuotes, loopIn, loopOutTerms, loopOutQuote, loopOutTermsAndQuotes, loopOut, swaps, swap } from '../../controllers/shared/loop.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPageSettings, savePageSettings } from '../../controllers/shared/pageSettings.js';

@ -224,7 +224,7 @@ export class DatabaseAdapter {
}
}
catch (err) {
throw new Error(err);
throw new Error(JSON.stringify(err));
}
const collectionFilePath = this.dbFilePath + sep + 'rtldb-' + this.selNode.ln_implementation + '-' + collectionName + '.json';
try {
@ -233,7 +233,7 @@ export class DatabaseAdapter {
}
}
catch (err) {
throw new Error(err);
throw new Error(JSON.stringify(err));
}
try {
const otherFiles = fs.readdirSync(this.dbFilePath);
@ -264,7 +264,7 @@ export class DatabaseAdapter {
return dataObj;
}
catch (err) {
throw new Error(err);
throw new Error(JSON.stringify(err));
}
}
getSelNode() {

@ -13,6 +13,6 @@
<style>html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:100%}@media only screen and (max-width: 56.25em){html{font-size:90%}}@media only screen and (max-width: 37.5em){html{font-size:80%}}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}</style><link rel="stylesheet" href="styles.3f91aa9da8de48ca.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.3f91aa9da8de48ca.css"></noscript></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.f39f73f89e0ce8a0.js" type="module"></script><script src="polyfills.8269cb405db5f44b.js" type="module"></script><script src="main.cb1bb8801aa97544.js" type="module"></script>
<script src="runtime.f39f73f89e0ce8a0.js" type="module"></script><script src="polyfills.3b53c3445d79dc67.js" type="module"></script><script src="main.cb1bb8801aa97544.js" type="module"></script>
</body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
import * as WebSocket from 'ws';
import WebSocket from 'ws';
import { Logger, LoggerService } from '../../utils/logger.js';
import { Common, CommonService } from '../../utils/common.js';

@ -75,12 +75,12 @@ export const authenticateUser = (req, res, next) => {
const password = req.body.authenticationValue;
if (common.rtl_pass === password && failed.count < ALLOWED_LOGIN_ATTEMPTS) {
if (req.body.twoFAToken && req.body.twoFAToken !== '') {
// if (!verifyToken(req.body.twoFAToken)) {
// logger.log({ selectedNode: req.session.selectedNode, level: 'ERROR', fileName: 'Authenticate', msg: 'Invalid Token! Failed IP ' + reqIP, error: { error: 'Invalid token.' } });
// failed.count = failed.count + 1;
// failed.lastTried = currentTime;
// return res.status(401).json(handleMultipleFailedAttemptsError(failed, currentTime, 'Invalid 2FA Token!'));
// }
if (!verifyToken(req.body.twoFAToken)) {
logger.log({ selectedNode: req.session.selectedNode, level: 'ERROR', fileName: 'Authenticate', msg: 'Invalid Token! Failed IP ' + reqIP, error: { error: 'Invalid token.' } });
failed.count = failed.count + 1;
failed.lastTried = currentTime;
return res.status(401).json(handleMultipleFailedAttemptsError(failed, currentTime, 'Invalid 2FA Token!'));
}
}
if (!req.session.selectedNode) { req.session.selectedNode = common.initSelectedNode; }
delete failedLoginAttempts[reqIP];

@ -11,7 +11,7 @@ export const getPageSettings = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Page Settings', msg: 'Getting Page Settings..' });
databaseService.find(req.session.selectedNode, CollectionsEnum.PAGE_SETTINGS).then((settings: any) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Page Settings', msg: 'Page Settings Received', data: settings });
return res.status(200).json(settings);
res.status(200).json(settings);
}).catch((errRes) => {
const err = common.handleError(errRes, 'Page Settings', 'Page Settings Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getBalance } from '../../controllers/cln/balance.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listChannels, openChannel, setChannelFee, closeChannel, getLocalRemoteBalance, listForwards, funderUpdatePolicy, listForwardsPaginated } from '../../controllers/cln/channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getFees } from '../../controllers/cln/fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo } from '../../controllers/cln/getInfo.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import infoCLRoutes from './getInfo.js';
import feesCLRoutes from './fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listInvoices, addInvoice, deleteExpiredInvoice } from '../../controllers/cln/invoices.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getRoute, listNode, listChannel, feeRates, listNodes } from '../../controllers/cln/network.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listOfferBookmarks, deleteOfferBookmark, listOffers, disableOffer, createOffer, fetchOfferInvoice } from '../../controllers/cln/offers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNewAddress, onChainWithdraw, getUTXOs } from '../../controllers/cln/onchain.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listPayments, postPayment } from '../../controllers/cln/payments.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPeers, postPeer, deletePeer } from '../../controllers/cln/peers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { decodePayments, decodePayment, signMessage, verifyMessage, listConfigs } from '../../controllers/cln/utility.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getChannels, getChannelStats, openChannel, updateChannelRelayFee, closeChannel } from '../../controllers/eclair/channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getFees, getPayments } from '../../controllers/eclair/fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo } from '../../controllers/eclair/getInfo.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import infoECLRoutes from './getInfo.js';
import feesECLRoutes from './fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listInvoices, getInvoice, createInvoice } from '../../controllers/eclair/invoices.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNodes } from '../../controllers/eclair/network.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNewAddress, getBalance, getTransactions, sendFunds } from '../../controllers/eclair/onchain.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { queryPaymentRoute, decodePayment, getSentPaymentsInformation, postPayment } from '../../controllers/eclair/payments.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPeers, connectPeer, deletePeer } from '../../controllers/eclair/peers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getBlockchainBalance } from '../../controllers/lnd/balance.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getAllChannels, getPendingChannels, getClosedChannels, postChannel, postTransactions, closeChannel, postChanPolicy } from '../../controllers/lnd/channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getBackup, getRestoreList, postBackupVerify, postRestore } from '../../controllers/lnd/channelsBackup.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getFees } from '../../controllers/lnd/fees.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo } from '../../controllers/lnd/getInfo.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getDescribeGraph, getGraphInfo, getAliasesForPubkeys, getGraphNode, getGraphEdge, getRemoteFeePolicy, getQueryRoutes } from '../../controllers/lnd/graph.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import infoRoutes from './getInfo.js';
import channelsRoutes from './channels.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { listInvoices, invoiceLookup, addInvoice } from '../../controllers/lnd/invoices.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { signMessage, verifyMessage } from '../../controllers/lnd/message.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getNewAddress } from '../../controllers/lnd/newAddress.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { decodePayment, decodePayments, getPayments, getAllLightningTransactions, paymentLookup } from '../../controllers/lnd/payments.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPeers, postPeer, deletePeer } from '../../controllers/lnd/peers.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { forwardingHistory } from '../../controllers/lnd/switch.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getTransactions, postTransactions } from '../../controllers/lnd/transactions.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { genSeed, updateSelNodeOptions, getUTXOs, operateWallet, bumpFee, labelTransaction, leaseUTXO, releaseUTXO } from '../../controllers/lnd/wallet.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getRTLConfigInitial, getRTLConfig, updateUISettings, update2FASettings, getConfig, getFile, updateSelectedNode, updateDefaultNode, updateServiceSettings, updateSSO, getCurrencyRates } from '../../controllers/shared/RTLConf.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { authenticateUser, verifyToken, resetPassword, logoutUser } from '../../controllers/shared/authenticate.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getInfo, getServiceInfo, listSwaps, getSwapInfo, createSwap, createReverseSwap, createChannel, deposit } from '../../controllers/shared/boltz.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import authenticateRoutes from './authenticate.js';
import boltzRoutes from './boltz.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { loopInTerms, loopInQuote, loopInTermsAndQuotes, loopIn, loopOutTerms, loopOutQuote, loopOutTermsAndQuotes, loopOut, swaps, swap } from '../../controllers/shared/loop.js';

@ -1,4 +1,4 @@
import * as exprs from 'express';
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getPageSettings, savePageSettings } from '../../controllers/shared/pageSettings.js';

@ -329,7 +329,7 @@ export class CommonService {
if (exists) {
try {
this.cookie_value = fs.readFileSync(this.rtl_cookie_path, 'utf-8');
} catch (err: any) {
} catch (err) {
this.logger.log({ selectedNode: this.initSelectedNode, level: 'ERROR', fileName: 'Config', msg: 'Something went wrong while reading cookie: \n' + err });
throw new Error(err);
}
@ -339,7 +339,7 @@ export class CommonService {
this.createDirectory(directoryName);
fs.writeFileSync(this.rtl_cookie_path, crypto.randomBytes(64).toString('hex'));
this.cookie_value = fs.readFileSync(this.rtl_cookie_path, 'utf-8');
} catch (err: any) {
} catch (err) {
this.logger.log({ selectedNode: this.initSelectedNode, level: 'ERROR', fileName: 'Config', msg: 'Something went wrong while reading the cookie: \n' + err });
throw new Error(err);
}
@ -350,7 +350,7 @@ export class CommonService {
try {
fs.writeFileSync(this.rtl_cookie_path, crypto.randomBytes(64).toString('hex'));
this.cookie_value = fs.readFileSync(this.rtl_cookie_path, 'utf-8');
} catch (err: any) {
} catch (err) {
this.logger.log({ selectedNode: this.initSelectedNode, level: 'ERROR', fileName: 'Common', msg: 'Something went wrong while refreshing cookie', error: err });
throw new Error(err);
}
@ -364,7 +364,7 @@ export class CommonService {
if (!fs.existsSync(curDir)) {
fs.mkdirSync(curDir);
}
} catch (err: any) {
} catch (err) {
if (err.code !== 'EEXIST') {
if (err.code === 'ENOENT') {
throw new Error(`ENOENT: No such file or directory, mkdir '${directoryName}'. Ensure that the path separator is '${sep}'`);

@ -225,16 +225,16 @@ export class DatabaseAdapter {
if (!fs.existsSync(this.dbFilePath)) {
this.common.createDirectory(this.dbFilePath);
}
} catch (err: any) {
throw new Error(err);
} catch (err) {
throw new Error(JSON.stringify(err));
}
const collectionFilePath = this.dbFilePath + sep + 'rtldb-' + this.selNode.ln_implementation + '-' + collectionName + '.json';
try {
if (!fs.existsSync(collectionFilePath)) {
fs.writeFileSync(collectionFilePath, '[]');
}
} catch (err: any) {
throw new Error(err);
} catch (err) {
throw new Error(JSON.stringify(err));
}
try {
const otherFiles = fs.readdirSync(this.dbFilePath);
@ -264,8 +264,8 @@ export class DatabaseAdapter {
const dataFromFile = fs.readFileSync(collectionFilePath, 'utf-8');
const dataObj = !dataFromFile ? null : (<Collections>JSON.parse(dataFromFile));
return dataObj;
} catch (err: any) {
throw new Error(err);
} catch (err) {
throw new Error(JSON.stringify(err));
}
}

@ -1,9 +1,8 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ValidatorFn, ValidationErrors } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ValidationErrors, AbstractControlOptions } from '@angular/forms';
import { STEPPER_GLOBAL_OPTIONS } from '@angular/cdk/stepper';
import { MatStepper } from '@angular/material/stepper';
@ -50,7 +49,7 @@ export class InitializeWalletComponent implements OnInit, OnDestroy {
this.passwordFormGroup = this.formBuilder.group({
initWalletPassword: ['', [Validators.required, Validators.minLength(8)]],
initWalletConfirmPassword: ['', [Validators.required, Validators.minLength(8)]]
}, { validators: matchedPasswords });
}, { validators: matchedPasswords } as AbstractControlOptions);
this.cipherFormGroup = this.formBuilder.group({
existingCipher: [false],
cipherSeed: [{ value: '', disabled: true }, [cipherSeedLength]]

@ -5,7 +5,7 @@
"outDir": "./backend",
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"strict": false,
"noImplicitOverride": false,
"noPropertyAccessFromIndexSignature": false,
"strictPropertyInitialization":false,

Loading…
Cancel
Save