chore:little fixes and formating and linting and patches

This commit is contained in:
2026-03-31 15:50:54 +02:00
parent a1ce71ffb6
commit 9b197abcfa
815 changed files with 22960 additions and 8982 deletions

View File

@@ -31,14 +31,20 @@ async function main() {
const host =
getArg(values.host) || (await rl.question('Remote Host (IP/Domain): '));
if (!host) throw new Error('Host is required');
if (!host) {
throw new Error('Host is required');
}
const user = getArg(values.user) || (await rl.question('Remote User: '));
if (!user) throw new Error('User is required');
if (!user) {
throw new Error('User is required');
}
const password =
getArg(values.password) || (await rl.question('Remote Password: '));
if (!password) throw new Error('Password is required');
if (!password) {
throw new Error('Password is required');
}
const dbName =
getArg(values.db) ||
@@ -48,17 +54,21 @@ async function main() {
const startDate =
getArg(values.start) ||
(await rl.question('Start Date (YYYY-MM-DD HH:mm:ss): '));
if (!startDate) throw new Error('Start date is required');
if (!startDate) {
throw new Error('Start date is required');
}
const endDate =
getArg(values.end) ||
(await rl.question('End Date (YYYY-MM-DD HH:mm:ss): '));
if (!endDate) throw new Error('End date is required');
if (!endDate) {
throw new Error('End date is required');
}
const projectIdsInput =
getArg(values.projects) ||
(await rl.question(
'Project IDs (comma separated, leave empty for all): ',
'Project IDs (comma separated, leave empty for all): '
));
const projectIds = projectIdsInput
? projectIdsInput.split(',').map((s: string) => s.trim())

View File

@@ -1,4 +1,4 @@
import { TABLE_NAMES, ch } from '../src/clickhouse/client';
import { ch, TABLE_NAMES } from '../src/clickhouse/client';
import { clix } from '../src/clickhouse/query-builder';
const START_DATE = new Date('2025-11-10T00:00:00Z');
@@ -7,7 +7,7 @@ const SESSIONS_PER_HOUR = 2;
// Revenue between $10 (1000 cents) and $200 (20000 cents)
const MIN_REVENUE = 1000;
const MAX_REVENUE = 20000;
const MAX_REVENUE = 20_000;
function getRandomRevenue() {
return (
@@ -17,7 +17,7 @@ function getRandomRevenue() {
async function main() {
console.log(
`Starting revenue update for sessions between ${START_DATE.toISOString()} and ${END_DATE.toISOString()}`,
`Starting revenue update for sessions between ${START_DATE.toISOString()} and ${END_DATE.toISOString()}`
);
let currentDate = new Date(START_DATE);
@@ -44,7 +44,7 @@ async function main() {
const sessionIds = sessions.map((s: any) => s.id);
console.log(
`Found ${sessionIds.length} sessions to update: ${sessionIds.join(', ')}`,
`Found ${sessionIds.length} sessions to update: ${sessionIds.join(', ')}`
);
// 2. Construct update query