refactor: update import statements to use .js extensions

- Changed all import statements across the project to include the .js extension for consistency and to comply with ES module standards.
- Updated imports in various files including bootstrap.ts, shutdown.ts, config.ts, and many others.
- Ensured that all related modules and types are correctly imported with the new extension.
This commit is contained in:
Asep Haryana Saputra
2026-05-21 12:03:31 +00:00
parent 4cd92303ef
commit 0ef6fc8d31
56 changed files with 208 additions and 193 deletions
+20 -5
View File
@@ -1,8 +1,8 @@
import OpenAI from "openai";
import { config } from "../config.ts";
import { createChildLogger } from "../logger.ts";
import { retryWithBackoff } from "../retry.ts";
import type { AnalysisResult, AttachmentRecord, MessageRecord } from "./types";
import { config } from "../config.js";
import { createChildLogger } from "../logger.js";
import { retryWithBackoff } from "../retry.js";
import type { AnalysisResult, AttachmentRecord, MessageRecord } from "./types.js";
const log = createChildLogger("llmModerationClient");
const openai = new OpenAI({
@@ -35,9 +35,13 @@ const openai = new OpenAI({
}
}
const headers = new Headers(response.headers ?? undefined);
headers.set("Content-Type", "application/json");
headers.delete("Content-Length");
return new Response(normalizedBody, {
status: response.status ?? 200,
headers: response.headers ?? { "Content-Type": "application/json" },
headers,
});
},
});
@@ -592,6 +596,17 @@ Return ONLY valid JSON, no other text.`;
? parseError.message
: String(parseError);
lastInvalidContent = content;
log.warn(
{
error: lastParseError,
contentLength: content.length,
contentPreview: content.substring(0, 1000),
fullContent: content,
targetIds,
model: config.AI_LLM_MODEL,
},
"Failed to parse moderation response from LLM",
);
throw parseError;
}
},