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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user