Fix remaining TypeScript 'Untyped function calls' errors

- Add DatabaseAdapter type imports where needed
- Properly type database adapter calls with type assertions
- Fix type mismatches in schemaMappingService
- Fix ensureInitialized calls on DatabaseAdapter
This commit is contained in:
2026-01-21 09:39:58 +01:00
parent 6bb5907bbd
commit 9ad4bd9a73
6 changed files with 35 additions and 19 deletions

View File

@@ -12,6 +12,7 @@ import { normalizedCacheStore } from './normalizedCacheStore.js';
import { jiraAssetsClient } from './jiraAssetsClient.js';
import { jiraAssetsService } from './jiraAssets.js';
import { logger } from './logger.js';
import type { DatabaseAdapter } from './database/interface.js';
import type {
ApplicationComponent,
IctGovernanceModel,
@@ -126,7 +127,8 @@ async function getDescriptionFromDatabase(objectId: string): Promise<string | nu
const descriptionFieldNames = ['description', 'Description', 'DESCRIPTION'];
// First, get the object to find its type
const objRow = await db.queryOne<{ object_type_name: string }>(`
const typedDb = db as DatabaseAdapter;
const objRow = await typedDb.queryOne<{ object_type_name: string }>(`
SELECT object_type_name FROM objects WHERE id = ?
`, [objectId]);
@@ -134,7 +136,7 @@ async function getDescriptionFromDatabase(objectId: string): Promise<string | nu
// Try each possible description field name
for (const fieldName of descriptionFieldNames) {
const descRow = await db.queryOne<{ text_value: string }>(`
const descRow = await typedDb.queryOne<{ text_value: string }>(`
SELECT av.text_value
FROM attribute_values av
JOIN attributes a ON av.attribute_id = a.id
@@ -173,7 +175,8 @@ async function toReferenceValue(ref: ObjectReference | null | undefined): Promis
await db.ensureInitialized?.();
// Get basic object info from database
const objRow = await db.queryOne<{
const typedDb = db as DatabaseAdapter;
const objRow = await typedDb.queryOne<{
id: string;
object_key: string;
label: string;