- Call loadDynamicConfig() without dead supabaseService argument (Cosmos-backed). - Use getLegacySupabaseClient() for raw .from() queries in maintenance scripts. - manualOverrideCloseTrades: typed imports + legacy client for lifecycle SELECT. - verify_realtime: ESM .js imports and comment for subscribeToProfiles. - verifyTenantIsolation: comment for singleton monkey-patch. Made-with: Cursor
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { supabaseService } from '../src/services/SupabaseService.js';
|
|
import { getLegacySupabaseClient } from '../src/services/legacySupabaseClient.js';
|
|
import logger from '../src/utils/logger.js';
|
|
|
|
async function updateProfileName() {
|
|
const legacyClient = getLegacySupabaseClient();
|
|
if (!legacyClient) {
|
|
logger.error('❌ Legacy Supabase client not configured.');
|
|
return;
|
|
}
|
|
|
|
const profiles = await supabaseService.getActiveProfiles();
|
|
if (profiles.length === 0) return;
|
|
|
|
const targetProfile = profiles[0]; // The one we modified
|
|
const newName = "High Risk Scalper ⚡";
|
|
|
|
// Update Name in DB
|
|
// @ts-ignore
|
|
await legacyClient
|
|
.from('trade_profiles')
|
|
.update({ name: newName })
|
|
.eq('id', targetProfile.id);
|
|
|
|
logger.info(`✅ Profile Renamed to: [${newName}]`);
|
|
logger.info(`📋 Active Rules for this Profile:`);
|
|
|
|
// Display Rules
|
|
const config = targetProfile.strategy_config;
|
|
if (config && config.rules) {
|
|
config.rules.forEach((r: any) => {
|
|
logger.info(` - ${r.ruleId}: ${r.enabled ? '🟢 ENABLED' : '🔴 OFF'}`);
|
|
});
|
|
} else {
|
|
logger.info(' (Using Default Global Rules)');
|
|
}
|
|
}
|
|
|
|
updateProfileName();
|