Skip to content

Commit

Permalink
fix: remove the export defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Mersho committed Oct 25, 2023
1 parent bd242de commit aa140ea
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions app.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dotenv/config';
import { SocksProxyAgent } from "socks-proxy-agent";
import { MainContext, start } from "./bot/start";
import mongoConnect from './db_connect'
import { connect as mongoConnect } from './db_connect'
const { resubscribeInvoices } = require('./ln');
import logger from "./logger";
import { logger } from "./logger";
import { Telegraf } from "telegraf";
const { delay } = require('./util');

Expand Down
2 changes: 1 addition & 1 deletion bot/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const {
decimalRound,
getUserAge,
} = require('../util');
import logger from "../logger";
import { logger } from "../logger";
import { MainContext } from './start';
import { UserDocument } from '../models/user'
import { IOrder } from '../models/order'
Expand Down
4 changes: 2 additions & 2 deletions db_connect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mongoose, { ConnectOptions } from "mongoose";
import logger from "./logger";
import { logger } from "./logger";

// connect to database
const credentials = process.env.DB_USER
Expand All @@ -20,4 +20,4 @@ const connect = () => {
return mongoose;
};

export default connect;
export { connect };
4 changes: 2 additions & 2 deletions jobs/calculate_community_earnings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Order, Community } from '../models';
import logger from "../logger";
import { logger } from "../logger";

const calculateEarnings = async () => {
try {
Expand Down Expand Up @@ -42,4 +42,4 @@ const calculateEarnings = async () => {
}
};

export default calculateEarnings;
export { calculateEarnings };
4 changes: 2 additions & 2 deletions jobs/cancel_orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { User, Order } from "../models";
const { cancelShowHoldInvoice, cancelAddInvoice } = require('../bot/commands');
import * as messages from "../bot/messages";
import { getUserI18nContext, holdInvoiceExpirationInSecs } from '../util';
import logger from "../logger";
import { logger } from "../logger";

const cancelOrders = async (bot: Telegraf<MainContext>) => {
try {
Expand Down Expand Up @@ -99,4 +99,4 @@ const cancelOrders = async (bot: Telegraf<MainContext>) => {
}
};

export default cancelOrders;
export { cancelOrders };
4 changes: 2 additions & 2 deletions jobs/communities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Telegraf } from "telegraf";
import { MainContext } from "../bot/start";

import { Order, Community } from '../models';
import logger from "../logger";
import { logger } from "../logger";

const deleteCommunity = async (bot: Telegraf<MainContext>) => {
try {
Expand Down Expand Up @@ -34,4 +34,4 @@ const deleteCommunity = async (bot: Telegraf<MainContext>) => {
}
};

export default deleteCommunity;
export { deleteCommunity };
4 changes: 2 additions & 2 deletions jobs/delete_published_orders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MainContext } from "../bot/start";

import { Order } from '../models';
const { deleteOrderFromChannel } = require('../util');
import logger from "../logger";
import { logger } from "../logger";

const deleteOrders = async (bot: Telegraf<MainContext>) => {
try {
Expand Down Expand Up @@ -33,4 +33,4 @@ const deleteOrders = async (bot: Telegraf<MainContext>) => {
}
};

export default deleteOrders;
export { deleteOrders };
10 changes: 5 additions & 5 deletions jobs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import {
attemptPendingPayments,
attemptCommunitiesPendingPayments,
} from "./pending_payments";
import cancelOrders from "./cancel_orders";
import deleteOrders from "./delete_published_orders";
import calculateEarnings from './calculate_community_earnings'
import deleteCommunity from './communities'
import nodeInfo from './node_info'
import { cancelOrders } from "./cancel_orders";
import { deleteOrders } from "./delete_published_orders";
import { calculateEarnings } from './calculate_community_earnings';
import { deleteCommunity } from './communities';
import { info as nodeInfo } from './node_info';

export {
attemptPendingPayments,
Expand Down
4 changes: 2 additions & 2 deletions jobs/node_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MainContext } from "../bot/start";

import { Config } from '../models';
const { getInfo } = require('../ln');
import logger from "../logger";
import { logger } from "../logger";

const info = async (bot: Telegraf<MainContext>) => {
try {
Expand All @@ -21,4 +21,4 @@ const info = async (bot: Telegraf<MainContext>) => {
}
};

export default info;
export { info };
2 changes: 1 addition & 1 deletion jobs/pending_payments.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PendingPayment, Order, User, Community } from '../models';
import * as messages from '../bot/messages';
import logger from "../logger";
import { logger } from "../logger";
import { Telegraf } from 'telegraf';
import { I18nContext } from '@grammyjs/i18n';
import { MainContext } from '../bot/start';
Expand Down
4 changes: 2 additions & 2 deletions ln/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
cancelHoldInvoice,
getInvoice,
} from './hold_invoice';
import subscribeInvoice from './subscribe_invoice';
import { subscribeInvoice } from './subscribe_invoice';
const subscribeProbe = require('./subscribe_probe');
import resubscribeInvoices from './resubscribe_invoices';
import { resubscribeInvoices } from './resubscribe_invoices';
const { payRequest, payToBuyer, isPendingPayment } = require('./pay_request');
import { getInfo } from './info';

Expand Down
4 changes: 2 additions & 2 deletions ln/resubscribe_invoices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getInvoices, GetInvoicesResult } from 'lightning';
import { lnd } from './connect';
const subscribeInvoice = require('./subscribe_invoice');
import { Order } from '../models';
import logger from "../logger";
import { logger } from "../logger";

const resubscribeInvoices = async (bot: Telegraf<MainContext>) => {
try {
Expand Down Expand Up @@ -36,4 +36,4 @@ const resubscribeInvoices = async (bot: Telegraf<MainContext>) => {
}
};

export default resubscribeInvoices
export { resubscribeInvoices };
2 changes: 1 addition & 1 deletion ln/subscribe_invoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ const subscribeInvoice = async (bot: Telegraf<MainContext>, id: string, resub: b
}
};

export default subscribeInvoice;
export { subscribeInvoice };
2 changes: 1 addition & 1 deletion lnurl/lnurl-pay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import logger from "../logger";
import { logger } from "../logger";

// {
// pr: String, // bech32-serialized lightning invoice
Expand Down
2 changes: 1 addition & 1 deletion logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ const logger = winston.createLogger({
});


export default logger;
export { logger };
2 changes: 1 addition & 1 deletion tests/bot_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ordersActions = require('../bot/ordersActions');
const testUser = require('./user');
const testOrder = require('./order');
const { getCurrenciesWithPrice } = require('../util');
const mongoConnect = require('../db_connect').default;
const { connect: mongoConnect } = require('../db_connect');

mongoConnect();

Expand Down

0 comments on commit aa140ea

Please sign in to comment.